MergeFailed |
MergeFailedEventHandler MergeFailed; |
The MergeFailed event is raised during a Merge( ) operation when the target table and source table contain a column with the same name but differing data types or when the source and target tables have primary keys defined on different columns.
The following code demonstrates how to handle the MergeFailed event:
DataSet ds = new DataSet(); ds.MergeFailed += new MergeFailedEventHandler(ds_MergeFailed); private void ds_MergeFailed(object sender, MergeFailedEventArgs e) { MessageBox.Show("Failure in table: " + e.Table + Environment.NewLine + "Conflict = " + e.Conflict); }
The event handler receives an argument of type MergeFailedEventArgs containing properties that provide specific information about the event as described in Table 22-17.
Property |
Description |
---|---|
Conflict |
Gets the description of the merge conflict. |
Table |
Gets the DataTable object. |