Friday 30 March 2012

Read XML Document into string

// using System.IO;
// using System.Xml;


XmlDocument xdoc = new XmlDocument();
xdoc.Load("C:\\Export DataSet_INPUT.xml");

// Now create StringWriter object to get data from xml document.
StringWriter sw = new StringWriter();
XmlTextWriter xw = new XmlTextWriter(sw);
xdoc.WriteTo(xw);
String xmlstring = sw.ToString();

No comments:

Post a Comment