ForeignKeyConstraint Class System.Data Namespace
Returns the child columns of this constraint.
[ VB ]
Overridable Public ReadOnly Property Columns As DataColumn ( )
[ C# ]
public DataColumn [ ] Columns {virtual get;}
[ C++ ]
public: __property virtual DataColumn* get_Columns ( );
[ JScript ]
public function get Columns ( ) : DataColumn [ ]
An array of DataColumn objects representing the child columns of the constraint.
The following example returns an array of DataColumn objects through the Columns property.
[ VB ]
Private GetColumns ( )
Dim Cols ( ) 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
cols = dr.RelatedColumns
For i = 0 To Ubound ( cols )
Response.Write ( Cols ( i ).ColumnName
Next i
End If
Next
End Sub
ForeignKeyConstraint Members Table DataTable RelatedTable RelatedColumns