We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

datagrid constraint

hello everyone i have a table with primary key and some other fields, when i'm try to fill the other keys i get an exception of constraint, i would like to catch that exception and make my own. i have to remind you to i'm not do any update, only filling the cell and moving to other row in the datagrid. please help me

2 Replies

Administrator December 19, 2002 09:10 AM UTC

try this: Try ' your code goes here Catch ex As ConstraintException 'the exception type that you want to catch Throw New Exception("Test", ex) Catch all_ex As Exception 'catch all unhandled exceptions ' do something here End Try > hello everyone > i have a table with primary key and some other > fields, when i'm try to fill the other keys > i get an exception of constraint, > i would like to catch that exception and make my own. > > i have to remind you to i'm not do any update, only filling the cell and moving to other row in the datagrid. > > please help me

OU Oussax December 26, 2002 07:15 AM UTC

try this: set the EnforceConstraints of your dataset to false this.myDataSet.EnforceConstraints = false; this will stop the messages. But you will have to find a way to create your messages. on RowChanging or CurrentCellChanged events
Loader.
Live Chat Icon For mobile
Up arrow icon