附上上面的代码
<?xml version="1.0" encoding="UTF-8"?>
<QUERIES>
<QUERY ID="XLIGR">
SELECT trim(QUERY.CDKEY1) as Product, trim(QUERY.CDKEY2) as QUERY, trim(QUERY.CDDESC) as Description,QUERY.EFFDTE as Effective_Date,
QUERY.ENDDTE as Expire_Date FROM XLINS.DWXF347 QUERY WHERE QUERY.GRP = 'XLIGR' UNION SELECT trim(CanadaQUERY.CDKEY1) as Product,
trim(CanadaQUERY.CDKEY2) as QUERY, trim(CanadaQUERY.CDDESC) as Description,CanadaQUERY.EFFDTE as Effective_Date,CanadaQUERY.ENDDTE as Expire_Date
FROM XLCANADA.DWXF347 CanadaQUERY WHERE CanadaQUERY.GRP = 'XLESCAN'
</QUERY>
<QUERY ID="XLIE">
SELECT trim(QUERY.CDKEY1) as Product, trim(QUERY.CDKEY2) as QUERY, trim(QUERY.CDDESC) as Description,QUERY.EFFDTE as Effective_Date,
QUERY.ENDDTE as Expire_Date FROM XLINS.DWXF347 QUERY WHERE (QUERY.GRP = 'XLDATA' OR QUERY.GRP='MIDMARKET')UNION SELECT trim(CanadaQUERY.CDKEY1) as Product,
trim(CanadaQUERY.CDKEY2) as QUERY, trim(CanadaQUERY.CDDESC) as Description,CanadaQUERY.EFFDTE as Effective_Date,CanadaQUERY.ENDDTE as Expire_Date
FROM XLCANADA.DWXF347 CanadaQUERY WHERE (CanadaQUERY.GRP = 'XLESCAN' OR CanadaQUERY.GRP='CANDATA')
</QUERY>
<QUERY ID="XLES">
SELECT trim(QUERY.CDKEY1) as Product, trim(QUERY.CDKEY2) as QUERY, trim(QUERY.CDDESC) as Description,QUERY.EFFDTE as Effective_Date,
QUERY.ENDDTE as Expire_Date FROM XLINS.DWXF347 QUERY WHERE QUERY.GRP = 'XLES' UNION SELECT trim(CanadaQUERY.CDKEY1) as Product,
trim(CanadaQUERY.CDKEY2) as QUERY, trim(CanadaQUERY.CDDESC) as Description,CanadaQUERY.EFFDTE as Effective_Date,CanadaQUERY.ENDDTE as Expire_Date
FROM XLCANADA.DWXF347 CanadaQUERY WHERE CanadaQUERY.GRP = 'XLESCAN'
</QUERY>
<QUERY ID="XLIN">
SELECT trim(QUERY.CDKEY1) as Product, trim(QUERY.CDKEY2) as QUERY, trim(QUERY.CDDESC) as Description,QUERY.EFFDTE as Effective_Date,
QUERY.ENDDTE as Expire_Date FROM INCOMING.DWXF347 QUERY WHERE QUERY.GRP = 'INCOMING' UNION SELECT trim(CanadaQUERY.CDKEY1) as Product,
trim(CanadaQUERY.CDKEY2) as QUERY, trim(CanadaQUERY.CDDESC) as Description,CanadaQUERY.EFFDTE as Effective_Date,CanadaQUERY.ENDDTE as Expire_Date
FROM XLCANADA.DWXF347 CanadaQUERY WHERE CanadaQUERY.GRP = 'XLESCAN'
</QUERY>
<QUERY ID="XLSP">
SELECT trim(QUERY.CDKEY1) as Product, trim(QUERY.CDKEY2) as QUERY, trim(QUERY.CDDESC) as Description,QUERY.EFFDTE as Effective_Date,
QUERY.ENDDTE as Expire_Date FROM XLINS.DWXF347 QUERY WHERE QUERY.GRP = 'XLSELPROF' UNION SELECT trim(CanadaQUERY.CDKEY1) as Product,
trim(CanadaQUERY.CDKEY2) as QUERY, trim(CanadaQUERY.CDDESC) as Description,CanadaQUERY.EFFDTE as Effective_Date,CanadaQUERY.ENDDTE as Expire_Date
FROM XLCANADA.DWXF347 CanadaQUERY WHERE CanadaQUERY.GRP = 'XLESCAN'
</QUERY>
<QUERY ID="XLCN">
SELECT trim(QUERY.CDKEY1) as Product, trim(QUERY.CDKEY2) as QUERY, trim(QUERY.CDDESC) as Description,QUERY.EFFDTE as Effective_Date,
QUERY.ENDDTE as Expire_Date FROM XLINS.DWXF347 QUERY WHERE QUERY.GRP = 'CONSTRUCT' UNION SELECT trim(CanadaQUERY.CDKEY1) as Product,
trim(CanadaQUERY.CDKEY2) as QUERY, trim(CanadaQUERY.CDDESC) as Description,CanadaQUERY.EFFDTE as Effective_Date,CanadaQUERY.ENDDTE as Expire_Date
FROM XLCANADA.DWXF347 CanadaQUERY WHERE CanadaQUERY.GRP = 'XLESCAN'
</QUERY>
<QUERIES>
我需要阅读内联并在 VB.net 中执行,然后使用 c# 代码调用它。我尝试过硬编码并在 vb .net 中执行查询并获得结果集作为数据集
private string GetSymbol(String argQueryID)
{
string l_Query;
XmlDocument l_XmlDoc = new XmlDocument();
//load the xml file
l_XmlDoc.Load(Server.MapPath("~/XML/Queries.config"));
l_Query = l_XmlDoc.SelectSingleNode("/QUERIES/QUERY[@ID='" + argQueryID + "']").InnerText;
return l_Query;
}