Assembly: System.Data (in System.Data.dll)
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.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.