Last post Jun 02, 2012 08:29 PM by Decker Dong - MSFT
May 31, 2012 07:05 PM|MattLong|LINK
I've been storing SQL statements inside my XML file. I now need to add a SQL statement with the less than operator inside the node, and its failing because XML sees this as a new node. How can I get around this, with having to re-work my application to handle
a different file format?
My Test Xml File.
<?xml version="1.0" encoding="UTF-8"?>
<SQL>SELECT * FROM TicketTable WHERE createddate < SYSDATE</SQL>
<ConnectionStr>Server=Test.Test.com; Database=TBase; Trusted_Connection=true; Integrated Security=False; UID=test;Password=test;</ConnectionStr>
May 31, 2012 07:19 PM|ignatandrei|LINK
WHERE createddate < SYSDATE
Jun 02, 2012 08:29 PM|Decker Dong - MSFT|LINK
I now need to add a SQL statement with the less than operator inside the node, and its failing because XML sees this as a new node. How can I get around this, with having to re-work my application to handle a different file format?
Just like the MVP's idea——Note it that some symbols like ">" or "<" or "&"……are very special so they cannot be used directly in the xml；So before doing this you should use string.Replace to replace them with other things，Something like：
string s = s.Replace("<","<"); //Suppose s has included the value read out from table with sql statement……