語言

DataRow.SetParentRow 方法

定義

設定 的 DataRow父列。

多載

名稱 Description
SetParentRow(DataRow)

設定 的 DataRow 父列,並指定新的父 DataRow列。

SetParentRow(DataRow, DataRelation)

設定 的 DataRow 父列,指定新父 DataRow 列與 DataRelation。

SetParentRow(DataRow)

來源:
DataRow.cs
來源:
DataRow.cs
來源:
DataRow.cs
來源:
DataRow.cs
來源:
DataRow.cs

設定 的 DataRow 父列,並指定新的父 DataRow列。

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)

參數

parentRow
DataRow

新手父母 DataRow。

適用於

SetParentRow(DataRow, DataRelation)

來源:
DataRow.cs
來源:
DataRow.cs
來源:
DataRow.cs
來源:
DataRow.cs
來源:
DataRow.cs

設定 的 DataRow 父列,指定新父 DataRow 列與 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)

參數

parentRow
DataRow

新手父母 DataRow。

relation
DataRelation

與使用之間的關係 DataRelation 。

例外狀況

其中一列不屬於表格

其中一列是 null。

該關係不屬於物件的 DataRelationCollection 。DataSet

該關係的子 DataTable 節點並非該列所屬的表格。

範例

以下範例設定特定子列的父列。

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

適用於