Dataset constraints

  • Thread starter Thread starter Woody Splawn
  • Start date Start date
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?
 
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
 
Back
Top