How to load XML document from memory to Dataset

Author: Jon aka Poor Guy / Labels:

Came across this forum post while I try to find the solution. That's exactly what I try to do!!!
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1570786&SiteID=1

basically, in C#

//create the xmlDoc
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.PreserveWhitespace = true;
xmlDoc.Load(SOME_XML_FILE);
//insert your decryption code here

DataSet ds = new DataSet();
ds.ReadXml(new XmlTextReader(new System.IO.StringReader(xmlDoc.InnerXml)));

Pretty easy, isn't it?

0 comments: