System.Data.Constraint Class

Represents a constraint that can be enforced on one or more System.Data.DataColumn objects.

See Also: Constraint Members

Syntax

[System.ComponentModel.TypeConverter(typeof(System.Data.ConstraintConverter))]
[System.ComponentModel.DefaultProperty("ConstraintName")]
public abstract class Constraint

Remarks

A constraint is a rule used to maintain the integrity of the data in the System.Data.DataTable. For example, when you delete a value that is used in one or more related tables, a System.Data.ForeignKeyConstraint determines whether the values in the related tables are also deleted, set to null values, set to default values, or whether no action occurs. A System.Data.UniqueConstraint, on the other hand, just makes sure that all values within a particular table are unique. For more information, see Adding Constraints to a Table.

A base System.Data.Constraint constructor is not used. Primary or unique key constraints are created by using the System.Data.UniqueConstraint constructor, and foreign key constraints are created by using the System.Data.ForeignKeyConstraint constructor.

Requirements

Namespace: System.Data
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0, 2.0.0.0