Chapter 26. The Constraint Class

The Constraint class ensures data integrity in the disconnected DataSet. ADO.NET includes two types of constraints, both of which derive from the abstract Constraint class and aren’t specific to any provider. The UniqueKeyConstraint ensures that column values aren’t repeated in a single table and can optionally designate a specific column or group of columns as a primary key. The ForeignKeyConstraint ensures that column values in a child table correspond to values in the related parent table. In addition, the ForeignKeyConstraint can define rules that affect how deletions and updates are propagated between parent rows and their associated children.

Get ADO.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.