Export (0) Print
Expand All

DataSet.GetChanges Method

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

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

member GetChanges : unit -> DataSet 

Return Value

Type: System.Data.DataSet
A copy of the changes from this DataSet that can have actions performed on it and later be merged back in using Merge. If no changed rows are found, the method returns a null reference (Nothing in Visual Basic).

Creates a new DataSet that contains a copy of all rows in the original DataSet that have pending changes. Relationship constraints can cause additional unchanged rows to be added to the new DataSet if the unchanged rows contain primary keys corresponding to foreign keys in the changed rows. The method returns a null reference (Nothing in Visual Basic) if there are no rows in the original DataSet that have pending changes.

The following example creates a simple DataSet with one table, two columns, and ten rows. Two values are changed, and one row is added. A subset of the changed data is created using the GetChanges method. After reconciling errors, a new column is added to the subset, changing the schema. When the Merge method is called with the missingSchemaAction set to MissingSchemaAction.Add, the new column is added to the original DataSet object's schema.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2015 Microsoft