How To Write XML File From DataSet or DataTable?
It is very easy to create XML file filled with data from DataSet or DataTable object. Let say that you already filled DataSet object, named MyDataSet, with some data from database. Code to write XML file would be:
[ C# ]
MyDataSet.WriteXml(Server.MapPath("XMLFiles/MyXMLFile.xml"));
[ VB.NET ]
MyDataSet.WriteXml(Server.MapPath("XMLFiles/MyXMLFile.xml"))
On the same way, by using WriteXML property you can create an XML file from DataTable object.
Related articles:
1. Using ASP.NET With SQL Server
Copyright © 2002-2008 Bean Software. All rights reserved.