O'Reilly logo

Sams Teach Yourself ADO.NET in 24 Hours by Paul Bertucci, Jason Lefebvre

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a DataSet from an XML File

Internally, a DataSet is represented by XML. This enables a DataSet to accurately mirror data returned by any data source. In fact, this is one of the reasons the DataSet object in ADO.NET is so much more powerful than the recordset object in ADO 2.7. Not only does the DataSet store data, but it also stores data about the schema that was used to store the data. Because DataSets are essentially XML entities, moving data from a DataSet to XML and from XML into a DataSet is a painless and straightforward process.

The DataSet object has an overloaded method named ReadXml() that enables you to read XML data from a string, stream, or file. The example in Listing 10.2 demonstrates how to transfer the data and the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required