Reads the XML schema and data from the specified stream using the indicated read mode.
- stream
- The stream to read the data from.
- mode
- One of the System.Data.XmlReadMode values.
The System.Data.XmlReadMode used to read the data.
This method makes it possible to read the XML data and, optionally, the schema into the DataSet. Reading of the XML schema is possible with any of the overloaded versions of ReadXml that take System.Data.XmlReadMode as one of their parameters and setting the parameter to the ReadSchema value.
Whether or not the forms of ReadXml that do not take the System.Data.XmlReadMode read the schema, depends on whether the XML source contains the inline schema definition, that is the System.Data.XmlReadMode Auto setting is used. If the inline schema is found, it will be read and parsed before reading the data, possibly extending and modifying the existing data structure stored in the DataSet. Should any conflicts surface in the process, an exception will be raised. If no inline schema can be found, the existing relational structure is extended through inference, following the structure of the XML document. Should it happen that the structure cannot be extended, an exception will be raised.
Writing the schema of the DataSet into an XML file is possible using one of the overloaded DataSet.WriteXml methods.
Namespace: System.Data
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0