Working with Data—Storing the Data as XML
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| CSharp-Online.NET:Articles |
| Database Articles |
|
© 2006 Jeffery Suddeth |
Storing the Data as XML
The DataSet stores a collection of DataTables in its Tables property. To dump the entire DataSet to an XML file, we need to call the DataSet’s WriteXml method, passing the name of the file as a string. Reading the file back in is just a matter of calling the ReadXml method.
ds.WriteXml("customers.xml"); // dump to XML ds.ReadXml ("customers.xml"); // restore from XML
|

