I am getting the following error
The DELETE statement conflicted with the REFERENCE
The statement has been terminated.
I know what the problem is, but can anyone help me in catching this exception in the best possible way?
I do not want the user to delete the country if there are any FK contrains. Or a better way will be to ask the user if they want to delete the records referencing this "Country".
int countryID = Convert.ToInt32(gvCountry.DataKeys[e.RowIndex].Value);
db.DeleteCountry(1, 1, countryID);
gvCountry.EditIndex = -1;
**i am using linq to sql
View Complete Post