NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

UniqueConstraint.IsPrimaryKey

Gets a value indicating whether or not the constraint is on a primary key.

[Visual Basic]
Overridable Public ReadOnly Property IsPrimaryKey As Boolean
[C#]
public bool IsPrimaryKey {override get;}
[C++]
public: __property virtual bool get_IsPrimaryKey();
[JScript]
public function get IsPrimaryKey() : Boolean;

Property Value

true, if the constraint is on a primary key; otherwise, false.

Example [Visual Basic]

The following example checks the IsPrimaryKey property.

[Visual Basic]

Private Sub GetPrimaryKey()
   Dim rel As DataRelation
   Dim cstrt As UniqueConstraint
   ' Get a DataRelation from a DataSet.
   Set rel = DataSet1.Relations("CustomerOrders")
   ' Get the ParentKeyConstraint.
   Set cstrt = rel.ParentKeyConstraint
   ' Test if the IsPrimaryKey is true.
   If cstrt.IsPrimaryKey Then
      ' Do something
   End If
End Sub

See Also

UniqueConstraint Class | UniqueConstraint Members | System.Data Namespace