Export (0) Print
Expand All

TypedTableBase<T>.ReadXml Method

Reads XML schema and data into the DataTable.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method ReadXml(Stream) Reads XML schema and data into the DataTable using the specified Stream. (Inherited from DataTable.)
Public method ReadXml(String) Reads XML schema and data into the DataTable from the specified file. (Inherited from DataTable.)
Public method ReadXml(TextReader) Reads XML schema and data into the DataTable using the specified TextReader. (Inherited from DataTable.)
Public method ReadXml(XmlReader) Reads XML Schema and Data into the DataTable using the specified XmlReader. (Inherited from DataTable.)
Top

The ReadXml method provides a way to read either data only, or both data and schema into a DataTable from an XML document, whereas the ReadXmlSchema method reads only the schema. To read both data and schema, use one of the ReadXML overloads that include the XmlReadMode parameter, and set its value to ReadSchema.

Note that the same is true for the WriteXml and WriteXmlSchema methods, respectively. To write XML data, or both schema and data from the DataTable, use the WriteXml method. To write just the schema, use the WriteXmlSchema method.

Note Note

An InvalidOperationException will be thrown if a column type in the DataRow being read from or written to implements IDynamicMetaObjectProvider and does not implement IXmlSerializable.

Show:
© 2014 Microsoft