Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DataRow.SetParentRow Method (DataRow, DataRelation)

Sets the parent row of a DataRow with specified new parent DataRow and DataRelation.

Namespace:  System.Data
Assembly:  System.Data (in System.Data.dll)
Public Sub SetParentRow ( _
	parentRow As DataRow, _
	relation As DataRelation _


Type: System.Data.DataRow

The new parent DataRow.

Type: System.Data.DataRelation

The relation DataRelation to use.


One of the rows does not belong to a table


One of the rows is Nothing.


The relation does not belong to the DataRelationCollection of the DataSet object.


The relation's child DataTable is not the table this row belongs to.

The following example sets the parent row of a specific child row.

Private Sub SetParent()
    ' Get a ParentRow and a ChildRow from a DataSet. 
    Dim childRow As DataRow = _
    Dim parentRow As DataRow = _

    ' Set the parent row of a DataRelation.
    childRow.SetParentRow(parentRow, _
End Sub

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.