DataSet.SchemaSerializationMode 属性


获取或设置 SchemaSerializationModeDataSetGets or sets a SchemaSerializationMode for a DataSet.

 virtual property System::Data::SchemaSerializationMode SchemaSerializationMode { System::Data::SchemaSerializationMode get(); void set(System::Data::SchemaSerializationMode value); };
public virtual System.Data.SchemaSerializationMode SchemaSerializationMode { get; set; }
public virtual System.Data.SchemaSerializationMode SchemaSerializationMode { get; set; }
member this.SchemaSerializationMode : System.Data.SchemaSerializationMode with get, set
member this.SchemaSerializationMode : System.Data.SchemaSerializationMode with get, set
Public Overridable Property SchemaSerializationMode As SchemaSerializationMode



SchemaSerializationModeDataSetA SchemaSerializationMode for a DataSet.



DataSet默认情况下,在 Web 服务和远程处理方案中序列化其架构和实例数据。A DataSet serializes its schema and instance data by default in Web services and remoting scenarios. 设置 SchemaSerializationMode 类型化的属性将 DataSet ExcludeSchema 导致从序列化有效负载中排除架构信息。Setting the SchemaSerializationMode property of a typed DataSet to ExcludeSchema causes schema information to be excluded from the serialization payload.

ExcludeSchema 仅支持类型化 DataSetExcludeSchema is supported only for a typed DataSet. 对于非类型化的 DataSet 此属性,只能将设置为 IncludeSchemaFor an un-typed DataSet this property can only be set to IncludeSchema.

ExcludeSchema 仅应在基础类型化的架构信息未修改的情况下 DataTables 使用 DataRelations ConstraintsExcludeSchema should only be used in cases where the schema information of the underlying typed DataTables, DataRelations and Constraints has not been modified. 如果发生了修改,则应使用来序列化完整的架构信息 IncludeSchemaIf modifications have occurred, complete schema information should be serialized with IncludeSchema.

ExcludeSchema .NET Framework 或更高版本的2.0 版支持。ExcludeSchema is supported in version 2.0 of the .NET Framework or later.

如果 ExcludeSchema 设置了,则仅序列化上存在的顶级运行时属性 DataSetWhen ExcludeSchema is set, only the top level runtime properties present on the DataSet are serialized. 此外,仅当它们碰巧不同于默认值时,才会序列化它们。In addition, they are serialized only if they happen to be different from the default values. Tables Relations Constraints 不会序列化任何。None of the Tables, Relations or Constraints are serialized. 序列化的运行时属性包括 DataSetNameNamespacePrefixLocaleEnforceConstraintsCaseSensitiveThe serialized runtime properties include DataSetName, Namespace, Prefix, Locale, EnforceConstraints, and CaseSensitive. 将序列化这些属性,以确保保留总体运行时数据完整性。These properties are serialized to make sure that overall runtime data integrity is preserved.