Chapter 27. The DataRelation Class

The DataRelation class represents a parent-child relationship between two DataTable objects in the same DataSet. The DataRelation can be used as a navigational aid, or it can enforce relational integrity and cascade deletes or updates. In the latter case, the constraints are actually applied by the ForeignKeyConstraint class, which the DataRelation creates automatically when added to a DataSet.

As with all disconnected data classes, the DataRelation isn’t specific to any provider. DataRelation objects must be created manually; the provider can’t generate them based on the information in the data source.

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.