Gets the collection of child relations which belong to a specified table.
[Visual Basic] Public Function GetChildRelations( _ ByVal table As DataTable _ ) As RelationsCollection [C#] public RelationsCollection GetChildRelations( DataTable table ); [C++] public: RelationsCollection* GetChildRelations( DataTable* table ); [JScript] public function GetChildRelations( table : DataTable ) : RelationsCollection;
The child RelationsCollection that belongs to the DataTable.
In the following example, for each DataTable in the specified DataSet, the GetChildRelations method returns all child DataRelation objects. Each DataRelation is then used as an argument to the DataRow class's GetChildRows method to return any child DataRow objects. The value of each column in the array is then printed.
[Visual Basic]
Private Sub GetChildRowsFromDataRelation(myDataSet As DataSet) Dim t As DataTable Dim rels As RelationsCollection Dim dr As DataRelation Dim arrRows() As DataRow Dim r As DataRow Dim i As Integer Dim dc As DataColumn For Each t in myDataSet.Tables rels = myDataSet.GetChildRelations(t) For Each dr In rels For Each r In t.Rows arrRows = r.GetChildRows(dr) ' Print out the value of each column in the row. For i = 0 To UBound(arrRows) For Each dc In t.Columns Console.WriteLine(arrRows(i)(c)) Next dc Next i Next r Next dr Next t End Sub
DataSet Class | DataSet Members | System.Data Namespace | DataRelation | Relations