Synopsis
UniqueConstraint uc
= DataRelation.ParentKeyConstraint;
Retrieves the UniqueKeyConstraint
object that is
associated with this relationship, if it exists. This constraint is
applied to the DataColumn
in the parent table.
Example
The following code retrieves the associated
UniqueKeyConstraint
and displays some basic
information about it in a console window:
UniqueConstraint uc = dr.ParentKeyConstraint;
// Does this constraint represent a primary key?
Console.WriteLine(uc.IsPrimaryKey.ToString());