DataTable::ReadXml Method
Reads XML schema and data into the DataTable.
Assembly: System.Data (in System.Data.dll)
| Name | Description | |
|---|---|---|
![]() | ReadXml(Stream^) | |
![]() | ReadXml(String^) | Reads XML schema and data into the DataTable from the specified file. |
![]() | ReadXml(TextReader^) | Reads XML schema and data into the DataTable using the specified TextReader. |
![]() | ReadXml(XmlReader^) |
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 |
|---|
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. |

