ForeignKeyConstraint Class System.Data Namespace
The parent columns of this constraint.
[ VB ]
Overridable Public ReadOnly Property RelatedColumns As DataColumn ( )
[ C# ]
public DataColumn [ ] RelatedColumns {virtual get;}
[ C++ ]
public: __property virtual DataColumn* get_RelatedColumns ( );
[ JScript ]
public function get RelatedColumns ( ) : DataColumn [ ]
An array of DataColumn objects representing the parent columns of the constraint.
The following example returns an array of DataColumn objects through the RelatedColumns property.
[ VB ]
Private GetRelatedColumns ( )
Dim relCols ( ) As DataColumn
Dim dr As DataRelation
Dim i As Integer
' get the DataRelation from a DataSet.
For Each dr In myDataSet.Relations
If dr.GetType.ToString = "System.Data.ForeignKeyConstraint" Then
relCols = dr.RelatedColumns
For i = 0 To Ubound ( relCols )
Response.Write ( relCols ( i ).ColumnName
Next i
End If
Next
End Sub
ForeignKeyConstraint Members Columns DataColumn DataTable Table RelatedTable