22.5 Events Reference

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 .

Example

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); } 

Notes

The event handler receives an argument of type MergeFailedEventArgs containing properties that provide specific information about the event as described in Table 22-17.

Table 22-17. MergeFailedEventArgs properties

Property

Description

 Conflict 

Gets the description of the merge conflict.

 Table 

Gets the DataTable object.



ADO. NET in a Nutshell
ADO.NET in a Nutshell
ISBN: 0596003617
EAN: 2147483647
Year: 2005
Pages: 415

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net