Adding Constraint on a Column in DataTable

partham

Active member
Joined
Dec 27, 2005
Messages
41
Location
Kolkata, India
Programming Experience
10+
Dear Sir,

We would like to impose a constraint on a Numeric Column of a DataTable to entertain values within a certain range. This is to request you to kindly suggest how this could be acheived?

In general, please suggest some article or reference where we could understand what are the possibilities with System.Data.Constraint class. We are bit confused as we donot see too many attributes/methods in this class.

Regards,
 
You can't do it with the existing classes. You don't create a Constraint object directly because the class is declared MustInherit. There are only two types of constraints: ForeignKeyContraint and UniqueConstraint. You'd have to define your own class that inherited the Constraint class and provided the functionality you required.
 
Back
Top