dataset constraints (if they can be called so!)

  • Thread starter Thread starter mehdi_mousavi
  • Start date Start date
M

mehdi_mousavi

Hi folks,
Consider a typed dataset, that has got a datatable. The datatable, on
the other hand, has got some columns one of which is of type string. I
would like to know how am I supposed to limit the values that can be
set on the mentioned column to "choice1", "choice2" and "choice3".
i.e., I would like the runtime library throw an exception if someone
tries to set another value (out of those choices named above) for the
mentioned column.

[FYI: I'm using .NET FX 2.0 under VS 2005].

Any help would be highly appreciated,

TIA,
Mehdi
 
Hi,

AFAIK this is not supported. the best you could do is hook the ColumnChanged
event of the datatable

Cheers,
 
You create another table called for example "Detail".
and Insert those values into this table "Chioce 1"m"Chioce2","Choice3"
then create a relationship between your primary table and the "Detail"
table..

then If someone wants to enter another values into primary table that
dosen't exist in "Detail" table he gets an exception
 
Back
Top