|
|
You use an object of the DataRelation class to represent a relationship between two DataTable objects. You use a DataRelation object to model parent-child relationships between two database tables. By default, when you create a DataRelation, a UniqueConstraint and ForeignKeyConstraint are automatically added to your parent and child DataTable objects. Table 12.3 shows the DataRelation properties.
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
ChildColumns | DataColumn[] | Gets the array of child DataColumn objects. |
ChildKeyConstraint | ForeignKeyConstraint | Gets the ForeignKeyConstraint object for the DataRelation. |
ChildTable | DataTable | Gets the child DataTable object. |
DataSet | DataSet | Gets the DataSet to which the DataRelation belongs. |
ExtendedProperties | PropertyCollection | Gets the PropertyCollection object that you can use to store strings of additional information. |
Nested | bool | Gets or sets a bool value that indicates whether the DataRelation objects are nested. This is useful when defining hierarchical relationships in XML. The default is false. |
ParentColumns | DataColumn[] | Gets the array of parent DataColumn objects. |
ParentKeyConstraint | UniqueConstraint | Gets the UniqueConstraint object that ensures that DataColumn values in the parent DataTable are unique. |
ParentTable | DataTable | Gets the parent DataTable object. |
RelationName | string | Gets the name of the DataRelation object. |
|
|