System.Data.XmlReadMode Enumeration

Specifies how to read XML data and a relational schema into a System.Data.DataSet.

Syntax

public enum XmlReadMode

Remarks

Use the members of this enumeration when setting the ReadMode parameter of the DataSet.ReadXml(System.Xml.XmlReader) method.

Note:

Auto mode may be slower than setting System.Data.XmlReadMode to an explicit option.

Members

Member NameDescription
Auto

Default.

DiffGram

Reads a DiffGram, applying changes from the DiffGram to the System.Data.DataSet. The semantics are identical to those of a DataSet.Merge(DataSet) operation. As with the DataSet.Merge(DataSet) operation, DataRow.RowState values are preserved. Input to DataSet.ReadXml(System.Xml.XmlReader) with DiffGrams should only be obtained using the output from DataSet.WriteXml(System.IO.Stream) as a DiffGram.

Fragment

Reads XML fragments, such as those generated by executing FOR XML queries, against an instance of SQL Server. When System.Data.XmlReadMode is set to Fragment, the default namespace is read as the inline schema.

IgnoreSchema

Ignores any inline schema and reads data into the existing System.Data.DataSet schema. If any data does not match the existing schema, it is discarded (including data from differing namespaces defined for the System.Data.DataSet). If the data is a DiffGram, IgnoreSchema has the same functionality as DiffGram.

InferSchema

Ignores any inline schema, infers schema from the data and loads the data. If the System.Data.DataSet already contains a schema, the current schema is extended by adding new tables or adding columns to existing tables. An exception is thrown if the inferred table already exists but with a different namespace, or if any of the inferred columns conflict with existing columns.

InferTypedSchema

Ignores any inline schema, infers a strongly typed schema from the data, and loads the data. If the type cannot be inferred from the data, it is interpreted as string data. If the System.Data.DataSet already contains a schema, the current schema is extended, either by adding new tables or by adding columns to existing tables. An exception is thrown if the inferred table already exists but with a different namespace, or if any of the inferred columns conflict with existing columns.

ReadSchema

Reads any inline schema and loads the data. If the System.Data.DataSet already contains schema, new tables may be added to the schema, but an exception is thrown if any tables in the inline schema already exist in the System.Data.DataSet.

Requirements

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