System.Data.DataSet.ReadXmlSchema Method

Reads the XML schema from the specified System.Xml.XmlReader into the System.Data.DataSet.

Syntax

public void ReadXmlSchema (System.Xml.XmlReader reader)

Parameters

reader
The System.Xml.XmlReader from which to read.

Remarks

Use the DataSet.ReadXmlSchema(System.Xml.XmlReader) method to create the schema for a System.Data.DataSet. The schema includes table, relation, and constraint definitions.

The XML schema is written using the XSD standard.

Note:

Data corruption can occur if the msdata:DataType and the xs:type types do not match. No exception will be thrown.

The DataSet.ReadXmlSchema(System.Xml.XmlReader) method is generally invoked before invoking the DataSet.ReadXml(System.Xml.XmlReader) method which is used to fill the System.Data.DataSet.

The System.Xml.XmlReader class is abstract. A class that inherits from the XmlReader is the System.Xml.XmlTextReader class.

Note:

If the schema for your System.Data.DataSet contains elements of the same name, but different type, in the same namespace, an exception is be thrown when you attempt to read the schema into the System.Data.DataSet with DataSet.ReadXmlSchema(System.Xml.XmlReader). This exception does not occur if you are using .NET Framework version 1.0.

Requirements

Namespace: System.Data
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0