Dataset constraints

W

Woody Splawn

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?
 
D

David Browne

Woody Splawn said:
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?

try
{
//whatever
}
catch (ConstraintException ex)
{
throw new ConstraintException("whatever");
}

David
 
W

Woody Splawn

Yes, but where? That is, where do I place a try catch statement? In what
event?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top