asp.net.ph

XmlReadMode Enumeration

System.Data Namespace


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

Remarks

Use the members of this enumeration when setting the ReadMode parameter of the ReadXml method.

NOTE: Auto mode may be slower than setting XmlReadMode to an explicit option.

Members


Member Name Description
Auto Default. Performs the most appropriate of these actions:
  • If the data is a DiffGram, sets XmlReadMode to DiffGram.
  • If the dataset already has a schema, or the document contains an in-line schema, sets XmlReadMode to ReadSchema.
  • If the dataset does not already have a schema and the document does not contain an in-line schema, sets XmlReadMode to InferSchema.
DiffGram Reads a DiffGram, applying changes from the DiffGram to the DataSet. The semantics are identical to those of a Merge operation. As with the Merge operation, RowState values are preserved. Input to ReadXml with DiffGrams should only be obtained using the output from WriteXml as a DiffGram.

The target DataSet must have the same schema as the DataSet on which WriteXml as DiffGram is called. Otherwise the DiffGram merge operation fails, and an exception is thrown.

Fragment Reads XML documents containing inline XDR schema fragments, such as those generated by executing FOR XML schemas that include inline XDR schemaagainst an instance of SQL Server. When XmlReadMode is set to SqlXml, the default namespace is read as the inline schema.
IgnoreSchema Ignores any inline schema and reads data into the existing DataSet schema. If any data does not match the existing schema, it is discarded ( including data from differing namespaces defined for the DataSet ). If the data is a DiffGram, IgnoreSchema has the same functionality as DiffGram.
InferSchema Ignores any inline schema, infering schema from the data, and loads the data. If the DataSet already contains a schema, the current schema is extended by adding columns to existing tables, where they exist, and new tables where existing tables do not exist. An exception is thrown if a column already exists but has an incompatible mapping type property.
ReadSchema Reads any inline schema and loads the data. If the 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 DataSet.

See Also

XmlWriteMode Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph