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!

ForeignKeyConstraint.RelatedTable

Gets the parent table of this constraint.

[Visual Basic]
Overridable Public ReadOnly Property RelatedTable As DataTable
[C#]
public DataTable RelatedTable {virtual get;}
[C++]
public: __property virtual DataTable* get_RelatedTable();
[JScript]
public function get RelatedTable() : DataTable;

Property Value

The parent DataTable of this constraint.

Example [Visual Basic]

The following example gets the related DataTable for each ForeignKeyConstraint in a DataSet.

[Visual Basic]

Private GetRelatedTables()
   Dim dr As DataRelation
   Dim t As DataTable
   
   ' Get the DataRelation from a DataSet.
   For Each dr In DataSet1.Relations
      If dr.GetType.ToString = "System.Data.ForeignKeyConstraint" Then
        t = dr.RelatedTable
        Debug.Print t.TableName, t.Columns.Count, t.Rows.Count
     End If
     Next
End

See Also

ForeignKeyConstraint Class | ForeignKeyConstraint Members | System.Data Namespace | Columns | DataTable | Table | RelatedColumns