This documentation is archived and is not being maintained.

DataRow.SetParentRow Method

Sets the parent row of a DataRow.

Overload List

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

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Sub SetParentRow(DataRow)
[C#] public void SetParentRow(DataRow);
[C++] public: void SetParentRow(DataRow*);
[JScript] public function SetParentRow(DataRow);

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

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Sub SetParentRow(DataRow, DataRelation)
[C#] public void SetParentRow(DataRow, DataRelation);
[C++] public: void SetParentRow(DataRow*, DataRelation*);
[JScript] public function SetParentRow(DataRow, DataRelation);

Example

[Visual Basic] The following example sets the parent row of a given child row.

[Visual Basic] Note   This example shows how to use one of the overloaded versions of SetParentRow. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Private Sub SetParent()
    Dim childRow As DataRow
    Dim parentRow As DataRow
    ' Get a ParentRow and a ChildRow from a DataSet.
    childRow = DataSet1.Tables("Orders").Rows(1)
    parentRow = DataSet1.Tables("Customers").Rows(20)
    ' Set the parent row of a DataRelation.
    childRow.SetParentRow(parentRow, DataSet1.Relations("CustomerOrders"))
 End Sub

[C#, C++, JScript] No example is available for C#, C++, or JScript. To view a Visual Basic example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

DataRow Class | DataRow Members | System.Data Namespace

Show: