Sunday, August 26, 2007

ADO.net > DataRelation

DataRelation

• A Data Relation represents a parent/child relationship between two DataTable objects in the same DataSet
• A relation is set between two tables based on matching columns in the parent and the child tables
• The matching columns in the two related tables can have different names, but they must have same type
• All the data relations are stored in the Relations collection

=======================================

Important properties of DataRelation class

ChildColumns / ParentColumns >> Get Child/Parent DataColumns of the relation
ChildTable / ParentTable >> Get Child/Parent DataTable object of the relation
ChildKeyConstraint >> Get the ForeignKeyConstraint object of the relation
DataSet >> Get the DataSet to which the relation belongs
RelationName >> Get/Set the name of the relation
Nested >> Used for XML rendering

No comments: