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