W
Woody Splawn
Last week sometime I posted the message below but I, unfortunately, have not
yet received an answer to the problem. The question has to do with how to
intercept a constraint viloation message in code and give the user a
different message. Someone responed by saying that I should use a try catch
statement, which is obvious, but the question is, where do I place it?
Where do I place such a try catch or some other code to catch a constraint
violation before VS shows the default message. The original question
follows:
A question please.
Lets say I have a grid with its datasource as a dataset with three columns
in it; UserID (an auto generated ID), LastName and FirstName. Additionally,
lets say I want to restrict the user from entering two records with the same
last name and first name. I have created a constraint for LastName
FirstName in the dataset but I would like a different message than the
default message I get when the constraint is violated. Is there a way for
me to do this?
yet received an answer to the problem. The question has to do with how to
intercept a constraint viloation message in code and give the user a
different message. Someone responed by saying that I should use a try catch
statement, which is obvious, but the question is, where do I place it?
Where do I place such a try catch or some other code to catch a constraint
violation before VS shows the default message. The original question
follows:
A question please.
Lets say I have a grid with its datasource as a dataset with three columns
in it; UserID (an auto generated ID), LastName and FirstName. Additionally,
lets say I want to restrict the user from entering two records with the same
last name and first name. I have created a constraint for LastName
FirstName in the dataset but I would like a different message than the
default message I get when the constraint is violated. Is there a way for
me to do this?