G
Guest
I have a C# application that is using a DataGridView (DGV). The DGV uses a
table adapter to connect to the datasource, which uses a DataSet as the data.
The DataSet has some constraints placed on them (PK on two columns).
When I add / update a column that violates the PK constraint, I get an error
stating the following:
System.Data.ConstraintException: Column 'Item, BItem' is constrained to be
unique. at System.Data.UniqueConstraint.CheckConstraint........at
System.Windows.Forms.DataGridView.DataGridViewDataConnection.OnRowValidating.
To Replace this default dialog please handle the DataError event.
I cannot for the life of me find how to replace that "default dialog" or how
to trap for this error message. I know it must be in the DataSet
configuration, but not sure where to place a try.....catch. Google didn't
provide any results that helped correct this.
Would anyone be able to help me replace this default dialog?
Thanks
Andy
table adapter to connect to the datasource, which uses a DataSet as the data.
The DataSet has some constraints placed on them (PK on two columns).
When I add / update a column that violates the PK constraint, I get an error
stating the following:
System.Data.ConstraintException: Column 'Item, BItem' is constrained to be
unique. at System.Data.UniqueConstraint.CheckConstraint........at
System.Windows.Forms.DataGridView.DataGridViewDataConnection.OnRowValidating.
To Replace this default dialog please handle the DataError event.
I cannot for the life of me find how to replace that "default dialog" or how
to trap for this error message. I know it must be in the DataSet
configuration, but not sure where to place a try.....catch. Google didn't
provide any results that helped correct this.
Would anyone be able to help me replace this default dialog?
Thanks
Andy