如何在xml中使用大于符号来编写sql查询

时间:2016-09-29 03:58:58

标签: sql asp.net xml

//This is my xml file
<sql id="data8">select .......... and DATEDIFF(CURDATE(),modified_date) > 7 group by ......</sql>

//And i am accessing this in webmethod in aspx.cs page.

 var doc = new XmlDocument();
 doc.Load(Server.MapPath("XMLFile.xml"));
    string cmdstr = doc.DocumentElement.SelectSingleNode("//queries/sql[@id='data8']").InnerXml;

但我收到错误“'where子句'中的未知列'gt'”。请帮忙

1 个答案:

答案 0 :(得分:2)

请尝试阅读InnerText属性的值而不是InnerXml