O'Reilly logo

Essential ADO.NET by Bob Beauchemin

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

C.9. Elements without Attributes or Child Elements

If an element has no child elements or attributes, it will be inferred as a column. The ColumnMapping property of the column will be set to MappingType.Element. The text for child elements is stored in a row in the table. For example, consider the following XML:

<DocumentElement>
  <Element1>
    <ChildElement1>Text1</ChildElement1>
    <ChildElement2>Text2</ChildElement2>
  </Element1>
</DocumentElement>

The inference process will produce a table named “Element1” with two columns, “ChildElement1” and “ChildElement2.” The ColumnMapping property of both columns will be set to MappingType.Element.

DataSet: DocumentElement

Table: Element1

ChildElement1 ChildElement2
Text1 Text2

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