How to Save DataSet as XML Document

Waqas Anwar
09 June 2009
4933 Views

If you want to save data from DataSet into XML Document you can use WriteXml method as follows:

ds.WriteXml("C:\\Employees.xml");
If you just want to save Schema information not data you can use WriteXmlSchema method.

ds.WriteXmlSchema("C:\\Employees.xsd");