|
|
You use an object of the ForeignKeyConstraint class to represent a foreign key constraint between two DataTable objects. This ensures that each DataRow in your child DataTable has a matching DataRow in your parent DataTable. The ForeignKeyConstraint class is derived from the System.Data.Constraint class. Table 12.2 shows the ForeignKeyConstraint properties.
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
AcceptRejectRule | AcceptRejectRule | Gets or sets the AcceptRejectRule that indicates the action that is to take place when the AcceptChanges() method of the DataTable is called. The members of the System.Data.AcceptRejectRule enumeration are
The default is None. |
Columns | DataColumn[] | Gets the array of DataColumn objects from the child DataTable. |
ConstraintName | string | Gets the name of the UniqueConstraint object. |
DeleteRule | Rule | Gets or sets the Rule that indicates the action that is to take place when a DataRow in the parent DataTable is deleted. The members of the System.Data.Rule enumeration are
The default is Cascade. |
ExtendedProperties | PropertyCollection | Gets the PropertyCollection object that you can use to store strings of additional information. |
RelatedColumns | DataColumn[] | Gets the array of DataColumn objects in the parent DataTable for the UniqueConstraint. |
RelatedTable | DataTable | Gets the parent DataTable for the UniqueConstraint. |
Table | DataTable | Gets the child DataTable to which the UniqueConstraint belongs. |
UpdateRule | Rule | Gets or sets the Rule that indicates the action that is to take place when a DataRow in the parent DataTable is updated. See the DeleteRule property for the members of the Rule enumeration. The default is Cascade. |
|
|