DekGenius.com
[ Team LiB ] Previous Section Next Section

26.1 Comments/Troubleshooting

Constraint objects are contained in a ConstraintCollection. Every DataTable exposes a ConstraintCollection through its Constraints property, which can contain UniqueKeyConstraint and ForeignKeyConstraint objects.

Both UniqueKeyConstraint and ForeignKeyConstraint classes can be created manually. In addition, a UniqueKeyConstraint may be created automatically when filling a DataSet with schema information, and both a ForeignKeyConstraint and a UniqueKeyConstraint may be generated when a DataRelation is defined and added to a table. For more information, refer to Chapter 10.

    [ Team LiB ] Previous Section Next Section