Substitute error message when deleting from datagrid
Posted on 2015-01-23
in my datagrid a user has the ability to delete a row. However, some rows are tied to a relational database and the error pops up "the delete statement conflicted with the reference constraint "xxxxx" the conflict occurred in database "xxxx"......."
This happens when a record is tied to a foreign key. I would like a different error message to come up such as "This records contains hour entries. The record will not be deleted"
This new error message should happen when a person tries to delete a record from the datagrid and the previous error comes up.
How can I do that?