DataSet + XmlDocument = XmlDataDocument

The previous code snippets used some of the DataSet class’s XML features, but they weren’t terribly exciting. If you’re using these features simply to store the contents of a DataSet in a file and later to read that data back into your DataSet, the fact that ADO.NET is storing the data as XML is irrelevant.

If you’re really interested in working with the contents of a DataSet in XML format, you might want to consider loading the data into an XmlDocument object. This class has a Load method that you can use to load the contents of an XML file, so you could use a DataSet object’s WriteXml method to create your XML file and then call an XmlDocument object’s Load method to load the file. That might sound fine ...

Get Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.