Serializing XML from a Single DataTable or Multiple Unrelated DataTables

The first thing we'll look at is how to generate XML from a DataSet that contains a single table. In fact, in doing so, you'll quickly see how much attention the .NET development team has paid to integrating ADO.NET and XML. There are two main methods for serializing a DataSet to XML: WriteXml and GetXml. The WriteXml method is generally used when you want to persist the XML representation of a DataSet object's DataTable objects. This method has a number of overloads that allow you to use Stream and Writer object types as well as a file name and a value (XmlWriteMode) indicating the type of schema information you want included with the XML data. Several sections covering ...

Get Extending MFC Applications with the .NET Framework 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.