Mapping DataTable Columns to XML Node Types

As you've seen in the various sample functions, when a DataSet is serialized to XML, all of the columns (DataColumn objects) for each of the set's DataTable objects are output as XML elements. This might be fine for simple demos, but in a practical setting it probably won't be what you want all the time. To aid in controlling how DataColumn information is serialized to XML (in terms of the node type used), the DataColumn has a property called ColumnMapping that is set to any of the MappingType enumeration values shown in Table 8-1.

Table 8-1. MappingType Enumeration Values
Member NameDescription
AttributeMaps the column to an attribute of the element having the same name as the column parent's table name. ...

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.