This documentation is archived and is not being maintained.

DataRow.GetChildRows Method (String, DataRowVersion)

.NET Framework 1.1

Gets the child rows of a DataRow using the specified RelationName of a DataRelation, and DataRowVersion.

[Visual Basic]
Overloads Public Function GetChildRows( _
   ByVal relationName As String, _
   ByVal version As DataRowVersion _
) As DataRow()
public DataRow[] GetChildRows(
 string relationName,
 DataRowVersion version
public: DataRow* GetChildRows(
 String* relationName,
 DataRowVersion version
) [];
public function GetChildRows(
   relationName : String,
 version : DataRowVersion
) : DataRow[];


The RelationName of the DataRelation to use.
One of the DataRowVersion values specifying the version of the data to get. Possible values are Default, Original, Current, and Proposed.

Return Value

An array of DataRow objects (or an array of length zero).


Exception Type Condition
ArgumentException The relation and row do not belong to the same table.
ArgumentNullException The relation is a null reference (Nothing in Visual Basic).
RowNotInTableException The row does not belong to the table.
VersionNotFoundException The row does not have the requested DataRowVersion.


The DataTable also contains a collection of DataRelation objects that is returned by the ChildRelations property.

Use the HasVersion property to determine if the desired DataRowVersion exists.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DataRow Class | DataRow Members | System.Data Namespace | DataRow.GetChildRows Overload List