System.Data Namespace DataRelation Class
Returns the parent columns of this relation.
Script |
[ DataColumn [ ] variable = ] DataRelation.ParentColumns |
The property is read only with no default value.
The following example gets the parent columns of a DataRelation.
private void GetParentCols ( ) {
// get the data relation
DataRelation dr = myDataSet.Relations [ "CustomerOrders" ]
// get the parent columns.
DataColumn [ ] parentCols = dr.ParentColumns;
// print the ColumnName of each column.
int i;
for ( i = 0; i < parentCols.Length; i++ ) {
Response.Write ( parentCols [ ].ColumnName );
}
}
Private Sub GetParentCols ( )
' get the data relation
Dim dr As DataRelation = myDataSet.Relations ( "CustomerOrders" )
' get the parent columns.
Dim parentCols ( ) As DataColumn = dr.ParentColumns
' print the ColumnName of each column.
Dim i As Integer
For i = 0 to Ubound ( parentCols )
Response.Write ( parentCols ( i ).ColumnName )
Next i
End Sub |
|
C# |
VB |
DataRelation Members DataColumn ChildColumns