System.Data Namespace DataRelation Class
Returns the DataSet in which the DataRelation belongs.
Script |
[ DataSet variable = ] DataRelation.DataSet |
The property is read only with no default value.
The DataRelation objects in a DataRelationCollection associated with a DataSet is accessed through the DataSet.Relations property.
The following example gets the DataSet of a DataRelation.
private void GetRelDataSet ( myRelation As DataRelation )
// get the DataSet of the passed in DataRelation.
DataSet ds = myRelation.DataSet;
// print the table names of each table in the DataSet.
DataTable tbl;
foreach ( tbl in ds.Tables ) {
Response.Write ( tbl.TableName );
}
}
Private Sub GetRelDataSet ( myRelation As DataRelation )
' get the DataSet of the passed in DataRelation.
Dim ds As DataSet = myRelation.DataSet
' print the table names of each table in the DataSet.
Dim tbl As DataTable
For Each tbl In ds.Tables
Response.Write ( tbl.TableName )
Next
End Sub |
|
C# |
VB |
DataRelation Members DataSet Relations DataRelationCollection