System.Data Namespace DataRelation Class
Returns the parent table of this relation.
Script |
[ DataTable variable = ] DataRelation.ParentTable |
variable |
A DataTable that is the parent table of the relation. |
The property is read only with no default value.
The following example gets the parent DataTable of a DataRelation.
private void GetParentTable ( ) {
// get the data relation
DataRelation dr = myDataSet.Relations [ "CustomerOrders" ];
// get the parent DataTable of the relation.
DataTable tbl = dr.ParentTable;
// print the name and number of rows of the parent table.
Response.Write ( tbl.TableName + ", " + tbl.Rows.Count );
}
Private Sub GetParentTable ( )
' get the data relation
Dim dr As DataRelation = myDataSet.Relations ( "CustomerOrders" )
' get the parent DataTable of the relation.
Dim tbl As DataTable = dr.ParentTable
' print the name and number of rows of the parent table.
Response.Write ( tbl.TableName & ", " & tbl.Rows.Count )
End Sub |
|
C# |
VB |
DataRelation Members DataTable ChildTable