Filling DataSet Objects from XML

So far, you've seen how to serialize a DataSet object's schema and contents to XML and the various issues regarding the formatting of the XML. In this section, we'll do the reverse—fill a DataSet from an XML document using the DataSet::ReadXml method.

The ReadXml method is a mirror-image of the WriteXml method to the extent that, much as the WriteXml method takes an XmlWriteMode enumeration value as a parameter, the ReadXml method takes an XmlReadMode enumeration value that specifies how to read XML data and a relational schema into the DataSet. At its most basic level, the ReadXml method is incredibly easy to use. For example, let's say that you had run the DisplayRelationalDataInXml function in order to serialize ...

Get Extending MFC Applications with the .NET Framework now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.