Export (0) Print
Expand All
Expand Minimize
1 out of 1 rated this helpful - Rate this topic

XmlReadMode Enumeration

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

Namespace: System.Data
Assembly: System.Data (in system.data.dll)

public enum XmlReadMode
public enum XmlReadMode
public enum XmlReadMode
 Member nameDescription
Supported by the .NET Compact FrameworkAutoDefault.  

Performs the most appropriate of these actions:

If the data is a DiffGram, sets XmlReadMode to DiffGram.

-or-

If the dataset already has a schema, or the document contains an in-line schema, sets XmlReadMode to ReadSchema.

-or-

If the dataset does not already have a schema and the document does not contain an in-line schema, sets XmlReadMode to InferSchema.

Supported by the .NET Compact FrameworkDiffGramReads 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.

Supported by the .NET Compact FrameworkFragmentReads XML fragments, such as those generated by executing FOR XML queries, against an instance of SQL Server. When XmlReadMode is set to Fragment, the default namespace is read as the inline schema. 
Supported by the .NET Compact FrameworkIgnoreSchemaIgnores 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
Supported by the .NET Compact FrameworkInferSchemaIgnores any inline schema, infers schema from the data and loads the data. If the 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. 
Supported by the .NET Compact FrameworkInferTypedSchemaIgnores 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 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. 
Supported by the .NET Compact FrameworkReadSchemaReads 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

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

NoteNote:

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.