DataRow.SetParentRow Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the parent row of a DataRow.
Overloads
SetParentRow(DataRow) |
Sets the parent row of a DataRow with specified new parent DataRow. |
SetParentRow(DataRow, DataRelation) |
Sets the parent row of a DataRow with specified new parent DataRow and DataRelation. |
SetParentRow(DataRow)
- Source:
- DataRow.cs
- Source:
- DataRow.cs
- Source:
- DataRow.cs
public:
void SetParentRow(System::Data::DataRow ^ parentRow);
public void SetParentRow (System.Data.DataRow? parentRow);
public void SetParentRow (System.Data.DataRow parentRow);
member this.SetParentRow : System.Data.DataRow -> unit
Public Sub SetParentRow (parentRow As DataRow)
Parameters
Applies to
SetParentRow(DataRow, DataRelation)
- Source:
- DataRow.cs
- Source:
- DataRow.cs
- Source:
- DataRow.cs
Sets the parent row of a DataRow with specified new parent DataRow and DataRelation.
public:
void SetParentRow(System::Data::DataRow ^ parentRow, System::Data::DataRelation ^ relation);
public void SetParentRow (System.Data.DataRow? parentRow, System.Data.DataRelation? relation);
public void SetParentRow (System.Data.DataRow parentRow, System.Data.DataRelation relation);
member this.SetParentRow : System.Data.DataRow * System.Data.DataRelation -> unit
Public Sub SetParentRow (parentRow As DataRow, relation As DataRelation)
Parameters
- relation
- DataRelation
The relation DataRelation to use.
Exceptions
One of the rows does not belong to a table
One of the rows is null
.
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.
Examples
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 = _
DataSet1.Tables("Orders").Rows(1)
Dim parentRow As DataRow = _
DataSet1.Tables("Customers").Rows(20)
' Set the parent row of a DataRelation.
childRow.SetParentRow(parentRow, _
DataSet1.Relations("CustomerOrders"))
End Sub