Gets the child rows of this DataRow using the specified DataRelation.
Gets the child rows of this DataRow using the specified DataRelation.
[Visual Basic] Overloads Public Function GetChildRows(DataRelation) As DataRow ()
[C#] public DataRow[] GetChildRows(DataRelation);
[C++] public: DataRow* GetChildRows(DataRelation*) [];
[JScript] public function GetChildRows(DataRelation) : DataRow[];
Gets the child rows of this DataRow using the specified DataRelation and the specified DataRowVersion
[Visual Basic] Overloads Public Function GetChildRows(DataRelation, DataRowVersion) As DataRow ()
[C#] public DataRow[] GetChildRows(DataRelation, DataRowVersion);
[C++] public: DataRow* GetChildRows(DataRelation*, DataRowVersion) [];
[JScript] public function GetChildRows(DataRelation, DataRowVersion) : DataRow[];
The following example uses the GetChildRows to return the child DataRow objects for every child DataRelation in a DataTable. The value of each column in the row is then printed.
Note This example shows how to use one of the overloaded versions of GetChildRows. For other examples that may be available, see the individual overload topics.
[Visual Basic]
Private Sub GetChildRowsFromDataRelation(myTable As DataTable, ver As DataRowVersion) Dim dr As DataRelation Dim arrRows() As DataRow Dim r As DataRow Dim i As Integer Dim dc As DataColumn For Each dr In myTable.ChildRelations For Each r In myTable.Rows arrRows = r.GetChildRows(dr, ver) ' Print values of rows. For i = 0 To UBound(arrRows) For Each dc In myTable.Columns Console.WriteLine(arrRows(i)(dc)) Next dc Next i Next r Next dr End Sub