NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataSet.Merge (DataTable)

Merges this DataTable into a specified DataTable.

[Visual Basic]
Overloads Public Sub Merge( _
   ByVal table As DataTable _
)
[C#]
public void Merge(
   DataTable table
);
[C++]
public: void Merge(
   DataTable* table
);
[JScript]
public function Merge(
   table : DataTable
);

Parameters

table
The DataTable whose data and schema will be merged.

Exceptions

Exception Type Condition
ArgumentNullException The dataSet is a null reference (in Visual Basic Nothing).

Remarks

Merges the specified DataTable (the source) into the current DataSet (the target). An attempt is made to locate the source DataTable in this DataSet. If the schemas of the two tables are incompatible, the missing columns will be added.

When the Merge method is called, the schemas of the two DataSet objects are compared. If the source DataSet contains schema elements that are missing in the target, the schema elements are added to the target. The data is then merged. When merging rows that have a DataRowState value of Unchanged, Modified, or Deleted source rows, the source's primary key is used to search for target rows that have the same primary key values. When merging New source rows, the new primary key value is used to search for target rows that are also New and have matching new primary keys.

See Also

DataSet Class | DataSet Members | System.Data Namespace | DataSet.Merge Overload List