C# Class System.Data.DataSet

Inheritance: System.ComponentModel.MarshalByValueComponent, IListSource, IXmlSerializable, ISupportInitializeNotification, ISupportInitialize, ISerializable
Datei anzeigen Open project: dotnet/corefx Class Usage Examples

Private Properties

Property Type Description
Clone DataSet
DeserializeDataSet void
DeserializeDataSetData void
DeserializeDataSetProperties void
DeserializeDataSetSchema void
DeserializeRelations void
EnableConstraints void
EstimatedXmlStringSize int
FailedEnableConstraints void
FindTable DataTable
GetParentRelations DataRelationCollection
GetRemotingDiffGram string
GetXmlSchemaForRemoting string
IListSource IList
IXmlSerializable System.Xml.Schema.XmlSchema
IXmlSerializable void
IXmlSerializable void
InferSchema void
IsEmpty bool
MarkModifiedRows void
MarkRelatedRowsAsModified void
MoveToElement bool
MoveToElement void
OnClearFunctionCalled void
OnDataRowCreated void
OnInitialized void
OnMergeFailed void
OnRemoveRelationHack void
OnRemovedTable void
PublishLegacyWSDL bool
RaiseMergeFailed void
ReadEndElement void
ReadXDRSchema void
ReadXSDSchema void
ReadXml XmlReadMode
ReadXml XmlReadMode
ReadXmlDiffgram void
ReadXmlSchema void
ResetRelations void
ResetTables void
RestoreEnforceConstraints void
SerializeDataSet void
SerializeDataSetProperties void
SerializeRelations void
SetLocaleValue void
ShouldSerializeLocale bool
TopLevelTables System.Data.DataTable[]
TopLevelTables System.Data.DataTable[]
ValidateCaseConstraint bool
ValidateLocaleConstraint bool
WriteXmlSchema void
WriteXmlSchema void
WriteXmlSchema void
WriteXmlSchema void

Public Methods

Method Description
AcceptChanges ( ) : void

Commits all the changes made to this since it was loaded or the last time was called.

BeginInit ( ) : void
Clear ( ) : void

Clears the of any data by removing all rows in all tables.

Copy ( ) : DataSet

Copies both the structure and data for this .

CreateDataReader ( ) : DataTableReader
DataSet ( ) : System.Collections

Initializes a new instance of the class.

DataSet ( string dataSetName ) : System.Collections

Initializes a new instance of a class with the given name.

EndInit ( ) : void
GetChanges ( ) : DataSet

Returns a copy of the that contains all changes made to it since it was loaded or was last called.

GetChanges ( DataRowState rowStates ) : DataSet
GetDataSetSchema ( XmlSchemaSet schemaSet ) : XmlSchemaComplexType
GetObjectData ( SerializationInfo info, StreamingContext context ) : void
GetXml ( ) : string
GetXmlSchema ( ) : string
HasChanges ( ) : bool

Gets a value indicating whether the has changes, including new, deleted, or modified rows.

HasChanges ( DataRowState rowStates ) : bool

Gets a value indicating whether the has changes, including new, deleted, or modified rows, filtered by .

InferXmlSchema ( Stream stream, string nsArray ) : void

Infer the XML schema from the specified into the .

InferXmlSchema ( TextReader reader, string nsArray ) : void

Infer the XML schema from the specified into the .

InferXmlSchema ( XmlReader reader, string nsArray ) : void

Infer the XML schema from the specified into the .

InferXmlSchema ( string fileName, string nsArray ) : void

Infer the XML schema from the specified file into the .

Load ( IDataReader reader, LoadOption loadOption ) : void
Load ( IDataReader reader, LoadOption loadOption, FillErrorEventHandler errorHandler ) : void
Merge ( DataRow rows ) : void
Merge ( DataRow rows, bool preserveChanges, MissingSchemaAction missingSchemaAction ) : void
Merge ( DataSet dataSet ) : void

Merges this into a specified .

Merge ( DataSet dataSet, bool preserveChanges ) : void

Merges this into a specified preserving changes according to the specified argument.

Merge ( DataSet dataSet, bool preserveChanges, MissingSchemaAction missingSchemaAction ) : void

Merges this into a specified preserving changes according to the specified argument, and handling an incompatible schema according to the specified argument.

Merge ( DataTable table ) : void

Merges this into a specified .

Merge ( DataTable table, bool preserveChanges, MissingSchemaAction missingSchemaAction ) : void

Merges this into a specified . with a value to preserve changes made to the target, and a value to deal with missing schemas.

ReadXml ( Stream stream ) : XmlReadMode
ReadXml ( Stream stream, XmlReadMode mode ) : XmlReadMode
ReadXml ( TextReader reader ) : XmlReadMode
ReadXml ( TextReader reader, XmlReadMode mode ) : XmlReadMode
ReadXml ( XmlReader reader ) : XmlReadMode
ReadXml ( XmlReader reader, XmlReadMode mode ) : XmlReadMode

ReadXml ( string fileName ) : XmlReadMode
ReadXml ( string fileName, XmlReadMode mode ) : XmlReadMode
ReadXmlSchema ( Stream stream ) : void

Reads the XML schema from the specified into the .

ReadXmlSchema ( TextReader reader ) : void

Reads the XML schema from the specified into the .

ReadXmlSchema ( XmlReader reader ) : void

Reads the XML schema from the specified into the

ReadXmlSchema ( string fileName ) : void

Reads the XML schema from the specified file into the .

RejectChanges ( ) : void

This method rolls back all the changes to have been made to this DataSet since it was loaded or the last time AcceptChanges was called. Any rows still in edit-mode cancel their edits. New rows get removed. Modified and Deleted rows return back to their original state.

Reset ( ) : void

Resets the dataSet back to it's original state. Subclasses should override to restore back to it's original state.

WriteXml ( Stream stream ) : void
WriteXml ( Stream stream, XmlWriteMode mode ) : void

Writes schema and data for the DataSet.

WriteXml ( TextWriter writer ) : void
WriteXml ( TextWriter writer, XmlWriteMode mode ) : void
WriteXml ( XmlWriter writer ) : void
WriteXml ( XmlWriter writer, XmlWriteMode mode ) : void
WriteXml ( string fileName ) : void
WriteXml ( string fileName, XmlWriteMode mode ) : void
WriteXmlSchema ( Stream stream ) : void

Writes the structure as an XML schema to using the specified object.

WriteXmlSchema ( Stream stream, string>.Converter multipleTargetConverter ) : void

Writes the structure as an XML schema to using the specified object.

WriteXmlSchema ( TextWriter writer ) : void

Writes the structure as an XML schema to a object.

WriteXmlSchema ( TextWriter writer, string>.Converter multipleTargetConverter ) : void

Writes the structure as an XML schema to a object.

WriteXmlSchema ( XmlWriter writer ) : void

Writes the structure as an XML schema to an object.

WriteXmlSchema ( XmlWriter writer, string>.Converter multipleTargetConverter ) : void

Writes the structure as an XML schema to an object.

WriteXmlSchema ( string fileName ) : void

Writes the structure as an XML schema to a file.

WriteXmlSchema ( string fileName, string>.Converter multipleTargetConverter ) : void

Writes the structure as an XML schema to a file.

Protected Methods

Method Description
DataSet ( SerializationInfo info, StreamingContext context ) : System.Collections
DataSet ( SerializationInfo info, StreamingContext context, bool ConstructSchema ) : System.Collections
DetermineSchemaSerializationMode ( SerializationInfo info, StreamingContext context ) : SchemaSerializationMode
DetermineSchemaSerializationMode ( XmlReader reader ) : SchemaSerializationMode
GetSchemaSerializable ( ) : XmlSchema
GetSerializationData ( SerializationInfo info, StreamingContext context ) : void
InitializeDerivedDataSet ( ) : void
IsBinarySerialized ( SerializationInfo info, StreamingContext context ) : bool
OnPropertyChanging ( PropertyChangedEventArgs pcevent ) : void
OnRemoveRelation ( DataRelation relation ) : void

This method should be overriden by subclasses to restrict tables being removed.

OnRemoveTable ( DataTable table ) : void

This method should be overriden by subclasses to restrict tables being removed.

RaisePropertyChanging ( string name ) : void
ReadXmlSerializable ( XmlReader reader ) : void
ShouldSerializeRelations ( ) : bool

Indicates whether property should be persisted.

ShouldSerializeTables ( ) : bool

Indicates whether property should be persisted.

Private Methods

Method Description
Clone ( ) : DataSet
DeserializeDataSet ( SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat, SchemaSerializationMode schemaSerializationMode ) : void
DeserializeDataSetData ( SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat ) : void
DeserializeDataSetProperties ( SerializationInfo info, StreamingContext context ) : void
DeserializeDataSetSchema ( SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat, SchemaSerializationMode schemaSerializationMode ) : void
DeserializeRelations ( SerializationInfo info, StreamingContext context ) : void
EnableConstraints ( ) : void
EstimatedXmlStringSize ( ) : int
FailedEnableConstraints ( ) : void
FindTable ( DataTable baseTable, PropertyDescriptor props, int propStart ) : DataTable
GetParentRelations ( DataTable table ) : DataRelationCollection

Gets the collection of parent relations which belong to a specified table.

GetRemotingDiffGram ( DataTable table ) : string
GetXmlSchemaForRemoting ( DataTable table ) : string
IListSource ( ) : IList
IXmlSerializable ( ) : XmlSchema
IXmlSerializable ( XmlReader reader ) : void
IXmlSerializable ( XmlWriter writer ) : void
InferSchema ( XmlDocument xdoc, string excludedNamespaces, XmlReadMode mode ) : void
IsEmpty ( ) : bool
MarkModifiedRows ( TableChanges bitMatrix, DataRowState rowStates ) : void
MarkRelatedRowsAsModified ( TableChanges bitMatrix, DataRow row ) : void
MoveToElement ( XmlReader reader, int depth ) : bool
MoveToElement ( XmlReader reader ) : void
OnClearFunctionCalled ( DataTable table ) : void
OnDataRowCreated ( DataRow row ) : void
OnInitialized ( ) : void
OnMergeFailed ( MergeFailedEventArgs mfevent ) : void

Inheriting classes should override this method to handle this event. Call base.OnMergeFailed to send this event to any registered event listeners.

OnRemoveRelationHack ( DataRelation relation ) : void
OnRemovedTable ( DataTable table ) : void
PublishLegacyWSDL ( ) : bool
RaiseMergeFailed ( DataTable table, string conflict, MissingSchemaAction missingSchemaAction ) : void
ReadEndElement ( XmlReader reader ) : void
ReadXDRSchema ( XmlReader reader ) : void
ReadXSDSchema ( XmlReader reader, bool denyResolving ) : void
ReadXml ( XmlReader reader, XmlReadMode mode, bool denyResolving ) : XmlReadMode
ReadXml ( XmlReader reader, bool denyResolving ) : XmlReadMode
ReadXmlDiffgram ( XmlReader reader ) : void
ReadXmlSchema ( XmlReader reader, bool denyResolving ) : void
ResetRelations ( ) : void

Resets the property to its default state.

ResetTables ( ) : void

Resets the property to its default state.

RestoreEnforceConstraints ( bool value ) : void
SerializeDataSet ( SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat ) : void
SerializeDataSetProperties ( SerializationInfo info, StreamingContext context ) : void
SerializeRelations ( SerializationInfo info, StreamingContext context ) : void
SetLocaleValue ( CultureInfo value, bool userSet ) : void
ShouldSerializeLocale ( ) : bool
TopLevelTables ( ) : System.Data.DataTable[]
TopLevelTables ( bool forSchema ) : System.Data.DataTable[]
ValidateCaseConstraint ( ) : bool
ValidateLocaleConstraint ( ) : bool
WriteXmlSchema ( Stream stream, SchemaFormat schemaFormat, string>.Converter multipleTargetConverter ) : void
WriteXmlSchema ( TextWriter writer, SchemaFormat schemaFormat, string>.Converter multipleTargetConverter ) : void
WriteXmlSchema ( XmlWriter writer, SchemaFormat schemaFormat, string>.Converter multipleTargetConverter ) : void
WriteXmlSchema ( string fileName, SchemaFormat schemaFormat, string>.Converter multipleTargetConverter ) : void

Method Details

AcceptChanges() public method

Commits all the changes made to this since it was loaded or the last time was called.
public AcceptChanges ( ) : void
return void

BeginInit() public method

public BeginInit ( ) : void
return void

Clear() public method

Clears the of any data by removing all rows in all tables.
public Clear ( ) : void
return void

Copy() public method

Copies both the structure and data for this .
public Copy ( ) : DataSet
return DataSet

CreateDataReader() public method

public CreateDataReader ( ) : DataTableReader
return DataTableReader

DataSet() public method

Initializes a new instance of the class.
public DataSet ( ) : System.Collections
return System.Collections

DataSet() protected method

protected DataSet ( SerializationInfo info, StreamingContext context ) : System.Collections
info SerializationInfo
context System.Runtime.Serialization.StreamingContext
return System.Collections

DataSet() protected method

protected DataSet ( SerializationInfo info, StreamingContext context, bool ConstructSchema ) : System.Collections
info SerializationInfo
context System.Runtime.Serialization.StreamingContext
ConstructSchema bool
return System.Collections

DataSet() public method

Initializes a new instance of a class with the given name.
public DataSet ( string dataSetName ) : System.Collections
dataSetName string
return System.Collections

DetermineSchemaSerializationMode() protected method

protected DetermineSchemaSerializationMode ( SerializationInfo info, StreamingContext context ) : SchemaSerializationMode
info SerializationInfo
context System.Runtime.Serialization.StreamingContext
return SchemaSerializationMode

DetermineSchemaSerializationMode() protected method

protected DetermineSchemaSerializationMode ( XmlReader reader ) : SchemaSerializationMode
reader XmlReader
return SchemaSerializationMode

EndInit() public method

public EndInit ( ) : void
return void

GetChanges() public method

Returns a copy of the that contains all changes made to it since it was loaded or was last called.
public GetChanges ( ) : DataSet
return DataSet

GetChanges() public method

public GetChanges ( DataRowState rowStates ) : DataSet
rowStates DataRowState
return DataSet

GetDataSetSchema() public static method

public static GetDataSetSchema ( XmlSchemaSet schemaSet ) : XmlSchemaComplexType
schemaSet System.Xml.Schema.XmlSchemaSet
return System.Xml.Schema.XmlSchemaComplexType

GetObjectData() public method

public GetObjectData ( SerializationInfo info, StreamingContext context ) : void
info SerializationInfo
context System.Runtime.Serialization.StreamingContext
return void

GetSchemaSerializable() protected method

protected GetSchemaSerializable ( ) : XmlSchema
return System.Xml.Schema.XmlSchema

GetSerializationData() protected method

protected GetSerializationData ( SerializationInfo info, StreamingContext context ) : void
info SerializationInfo
context System.Runtime.Serialization.StreamingContext
return void

GetXml() public method

public GetXml ( ) : string
return string

GetXmlSchema() public method

public GetXmlSchema ( ) : string
return string

HasChanges() public method

Gets a value indicating whether the has changes, including new, deleted, or modified rows.
public HasChanges ( ) : bool
return bool

HasChanges() public method

Gets a value indicating whether the has changes, including new, deleted, or modified rows, filtered by .
public HasChanges ( DataRowState rowStates ) : bool
rowStates DataRowState
return bool

InferXmlSchema() public method

Infer the XML schema from the specified into the .
public InferXmlSchema ( Stream stream, string nsArray ) : void
stream Stream
nsArray string
return void

InferXmlSchema() public method

Infer the XML schema from the specified into the .
public InferXmlSchema ( TextReader reader, string nsArray ) : void
reader TextReader
nsArray string
return void

InferXmlSchema() public method

Infer the XML schema from the specified into the .
public InferXmlSchema ( XmlReader reader, string nsArray ) : void
reader XmlReader
nsArray string
return void

InferXmlSchema() public method

Infer the XML schema from the specified file into the .
public InferXmlSchema ( string fileName, string nsArray ) : void
fileName string
nsArray string
return void

InitializeDerivedDataSet() protected method

protected InitializeDerivedDataSet ( ) : void
return void

IsBinarySerialized() protected method

protected IsBinarySerialized ( SerializationInfo info, StreamingContext context ) : bool
info SerializationInfo
context System.Runtime.Serialization.StreamingContext
return bool

Load() public method

public Load ( IDataReader reader, LoadOption loadOption ) : void
reader IDataReader
loadOption LoadOption
return void

Load() public method

public Load ( IDataReader reader, LoadOption loadOption, FillErrorEventHandler errorHandler ) : void
reader IDataReader
loadOption LoadOption
errorHandler FillErrorEventHandler
return void

Merge() public method

public Merge ( DataRow rows ) : void
rows DataRow
return void

Merge() public method

public Merge ( DataRow rows, bool preserveChanges, MissingSchemaAction missingSchemaAction ) : void
rows DataRow
preserveChanges bool
missingSchemaAction MissingSchemaAction
return void

Merge() public method

Merges this into a specified .
public Merge ( DataSet dataSet ) : void
dataSet DataSet
return void

Merge() public method

Merges this into a specified preserving changes according to the specified argument.
public Merge ( DataSet dataSet, bool preserveChanges ) : void
dataSet DataSet
preserveChanges bool
return void

Merge() public method

Merges this into a specified preserving changes according to the specified argument, and handling an incompatible schema according to the specified argument.
public Merge ( DataSet dataSet, bool preserveChanges, MissingSchemaAction missingSchemaAction ) : void
dataSet DataSet
preserveChanges bool
missingSchemaAction MissingSchemaAction
return void

Merge() public method

Merges this into a specified .
public Merge ( DataTable table ) : void
table DataTable
return void

Merge() public method

Merges this into a specified . with a value to preserve changes made to the target, and a value to deal with missing schemas.
public Merge ( DataTable table, bool preserveChanges, MissingSchemaAction missingSchemaAction ) : void
table DataTable
preserveChanges bool
missingSchemaAction MissingSchemaAction
return void

OnPropertyChanging() protected method

protected OnPropertyChanging ( PropertyChangedEventArgs pcevent ) : void
pcevent System.ComponentModel.PropertyChangedEventArgs
return void

OnRemoveRelation() protected method

This method should be overriden by subclasses to restrict tables being removed.
protected OnRemoveRelation ( DataRelation relation ) : void
relation DataRelation
return void

OnRemoveTable() protected method

This method should be overriden by subclasses to restrict tables being removed.
protected OnRemoveTable ( DataTable table ) : void
table DataTable
return void

RaisePropertyChanging() protected method

protected RaisePropertyChanging ( string name ) : void
name string
return void

ReadXml() public method

public ReadXml ( Stream stream ) : XmlReadMode
stream Stream
return XmlReadMode

ReadXml() public method

public ReadXml ( Stream stream, XmlReadMode mode ) : XmlReadMode
stream Stream
mode XmlReadMode
return XmlReadMode

ReadXml() public method

public ReadXml ( TextReader reader ) : XmlReadMode
reader TextReader
return XmlReadMode

ReadXml() public method

public ReadXml ( TextReader reader, XmlReadMode mode ) : XmlReadMode
reader TextReader
mode XmlReadMode
return XmlReadMode

ReadXml() public method

public ReadXml ( XmlReader reader ) : XmlReadMode
reader XmlReader
return XmlReadMode

ReadXml() public method

public ReadXml ( XmlReader reader, XmlReadMode mode ) : XmlReadMode
reader XmlReader
mode XmlReadMode
return XmlReadMode

ReadXml() public method

public ReadXml ( string fileName ) : XmlReadMode
fileName string
return XmlReadMode

ReadXml() public method

public ReadXml ( string fileName, XmlReadMode mode ) : XmlReadMode
fileName string
mode XmlReadMode
return XmlReadMode

ReadXmlSchema() public method

Reads the XML schema from the specified into the .
public ReadXmlSchema ( Stream stream ) : void
stream Stream
return void

ReadXmlSchema() public method

Reads the XML schema from the specified into the .
public ReadXmlSchema ( TextReader reader ) : void
reader TextReader
return void

ReadXmlSchema() public method

Reads the XML schema from the specified into the
public ReadXmlSchema ( XmlReader reader ) : void
reader XmlReader
return void

ReadXmlSchema() public method

Reads the XML schema from the specified file into the .
public ReadXmlSchema ( string fileName ) : void
fileName string
return void

ReadXmlSerializable() protected method

protected ReadXmlSerializable ( XmlReader reader ) : void
reader XmlReader
return void

RejectChanges() public method

This method rolls back all the changes to have been made to this DataSet since it was loaded or the last time AcceptChanges was called. Any rows still in edit-mode cancel their edits. New rows get removed. Modified and Deleted rows return back to their original state.
public RejectChanges ( ) : void
return void

Reset() public method

Resets the dataSet back to it's original state. Subclasses should override to restore back to it's original state.
public Reset ( ) : void
return void

ShouldSerializeRelations() protected method

Indicates whether property should be persisted.
protected ShouldSerializeRelations ( ) : bool
return bool

ShouldSerializeTables() protected method

Indicates whether property should be persisted.
protected ShouldSerializeTables ( ) : bool
return bool

WriteXml() public method

public WriteXml ( Stream stream ) : void
stream Stream
return void

WriteXml() public method

Writes schema and data for the DataSet.
public WriteXml ( Stream stream, XmlWriteMode mode ) : void
stream Stream
mode XmlWriteMode
return void

WriteXml() public method

public WriteXml ( TextWriter writer ) : void
writer System.IO.TextWriter
return void

WriteXml() public method

public WriteXml ( TextWriter writer, XmlWriteMode mode ) : void
writer System.IO.TextWriter
mode XmlWriteMode
return void

WriteXml() public method

public WriteXml ( XmlWriter writer ) : void
writer System.Xml.XmlWriter
return void

WriteXml() public method

public WriteXml ( XmlWriter writer, XmlWriteMode mode ) : void
writer System.Xml.XmlWriter
mode XmlWriteMode
return void

WriteXml() public method

public WriteXml ( string fileName ) : void
fileName string
return void

WriteXml() public method

public WriteXml ( string fileName, XmlWriteMode mode ) : void
fileName string
mode XmlWriteMode
return void

WriteXmlSchema() public method

Writes the structure as an XML schema to using the specified object.
public WriteXmlSchema ( Stream stream ) : void
stream Stream A object used to write to a file.
return void

WriteXmlSchema() public method

Writes the structure as an XML schema to using the specified object.
public WriteXmlSchema ( Stream stream, string>.Converter multipleTargetConverter ) : void
stream Stream A object used to write to a file.
multipleTargetConverter string>.Converter A delegate used to convert into string.
return void

WriteXmlSchema() public method

Writes the structure as an XML schema to a object.
public WriteXmlSchema ( TextWriter writer ) : void
writer System.IO.TextWriter The object with which to write.
return void

WriteXmlSchema() public method

Writes the structure as an XML schema to a object.
public WriteXmlSchema ( TextWriter writer, string>.Converter multipleTargetConverter ) : void
writer System.IO.TextWriter The object with which to write.
multipleTargetConverter string>.Converter A delegate used to convert into string.
return void

WriteXmlSchema() public method

Writes the structure as an XML schema to an object.
public WriteXmlSchema ( XmlWriter writer ) : void
writer System.Xml.XmlWriter The object with which to write.
return void

WriteXmlSchema() public method

Writes the structure as an XML schema to an object.
public WriteXmlSchema ( XmlWriter writer, string>.Converter multipleTargetConverter ) : void
writer System.Xml.XmlWriter The object with which to write.
multipleTargetConverter string>.Converter A delegate used to convert into string.
return void

WriteXmlSchema() public method

Writes the structure as an XML schema to a file.
public WriteXmlSchema ( string fileName ) : void
fileName string The file name (including the path) to which to write.
return void

WriteXmlSchema() public method

Writes the structure as an XML schema to a file.
public WriteXmlSchema ( string fileName, string>.Converter multipleTargetConverter ) : void
fileName string The file name (including the path) to which to write.
multipleTargetConverter string>.Converter A delegate used to convert into string.
return void