C
cpnet
Say I table, "Stuff". It has 2 columns: "StuffId", "Description", and
"StuffId" is a primary key.
I know how to set an XSD schema that defines a DataSet that will hold this
table. However, if I want to add an additional constraint where
"Description" must be unique, how do I do that? Do I have to rely on the
database to enforce such a constraint, or code something into the
RowChanged/RowChanging events for the DataTable? To make things as easy as
possible for the user, I'd like not to have to wait for the database to
throw an error if this constraint is violated. It would be easiest if I
could define this in the xsd schema, but there doesn't seem to be a way.
What's the standard way to handle this sort of thing when dealing with
disconnected datasets?
Thanks
"StuffId" is a primary key.
I know how to set an XSD schema that defines a DataSet that will hold this
table. However, if I want to add an additional constraint where
"Description" must be unique, how do I do that? Do I have to rely on the
database to enforce such a constraint, or code something into the
RowChanged/RowChanging events for the DataTable? To make things as easy as
possible for the user, I'd like not to have to wait for the database to
throw an error if this constraint is violated. It would be easiest if I
could define this in the xsd schema, but there doesn't seem to be a way.
What's the standard way to handle this sort of thing when dealing with
disconnected datasets?
Thanks