This question is locked. New answers and comments are not allowed.
Hi,
I have setup an OpenAccess Model and I'm currently testing a few things. I'm using a WinForms app I have added a RadGrid on the form and set the datasource
I am then using the following events to capture Inserts/Deletes
This all works ok i can add/remove/update values
The issue I'm having is I have a Unique Index constraint on the e-mail column, if I try to add a employee with the same e-mail address then the SaveChanges will throw an exception. No data changes are then saved into the database but this is not flagged in then application
How should I be handling these sort of errors?
Thanks
I have setup an OpenAccess Model and I'm currently testing a few things. I'm using a WinForms app I have added a RadGrid on the form and set the datasource
this
.radGridView1.DataSource = Context.Employees.ToList<Employee>();
I am then using the following events to capture Inserts/Deletes
this
.radGridView1.UserAddedRow +=
new
Telerik.WinControls.UI.GridViewRowEventHandler(radGridView1_UserAddedRow);
this
.radGridView1.UserDeletingRow +=
new
Telerik.WinControls.UI.GridViewRowCancelEventHandler(radGridView1_UserDeletingRow);
This all works ok i can add/remove/update values
The issue I'm having is I have a Unique Index constraint on the e-mail column, if I try to add a employee with the same e-mail address then the SaveChanges will throw an exception. No data changes are then saved into the database but this is not flagged in then application
How should I be handling these sort of errors?
Thanks