Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi all,

I am Generating a XML from a DataTable for some calculation purpose. But what happen to my XML is the column names were prefixed by some JUNK/UNKNOWN values. does any one have come accross this problem please let me know.

The code what is used to generate XML from my DataTable

C#
using (MemoryStream ms = new MemoryStream())
           {
               // Get XML from DataTable
               DistinctDataTable.WriteXml(ms);
               ms.Position = 0;

               // load the Global XML with the distinct Data in the form of XML.
               XmlDocument.Load(ms);
           }


The Output XML

XML
<DQM>
<_x0031_5010/>
<_x0031_5011>08/14/2013</_x0031_5011>
<_x0031_5012>05/30/2000</_x0031_5012>
<_x0031_5013>Lst1</_x0031_5013>
<_x0031_5014>Ent151</_x0031_5014>
<_x0031_5015>Test PA</_x0031_5015>
<_x0031_5016>Eagle PACE</_x0031_5016>
<_x0031_5021>2</_x0031_5021>
</DQM>


from the above XML in the Tag section other than _x0031_ is what the COLUMN/FIELD name. but i am getting _x0031_ as a prefix what could be the problem. Is there is any problem in my logic or in the WriteXml itself

Note:
Please let me know if any one can't understand my question?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900