DataRow.SetParentRow Méthode

Définition

Définit la ligne parente d’un DataRow.

Surcharges

Nom Description
SetParentRow(DataRow)

Définit la ligne parente d’un DataRow nouveau parent DataRowspécifié.

SetParentRow(DataRow, DataRelation)

Définit la ligne parente d’un DataRow nouveau parent DataRow spécifié et DataRelation.

SetParentRow(DataRow)

Définit la ligne parente d’un DataRow nouveau parent DataRowspécifié.

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)

Paramètres

parentRow
DataRow

Nouveau parent DataRow.

S’applique à

SetParentRow(DataRow, DataRelation)

Définit la ligne parente d’un DataRow nouveau parent DataRow spécifié et DataRelation.

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)

Paramètres

parentRow
DataRow

Nouveau parent DataRow.

relation
DataRelation

Relation DataRelation à utiliser.

Exceptions

L’une des lignes n’appartient pas à une table

L’une des lignes est null.

La relation n’appartient pas à l’objet DataRelationCollectionDataSet .

L’enfant DataTable de la relation n’est pas la table à laquelle appartient cette ligne.

Exemples

L’exemple suivant définit la ligne parente d’une ligne enfant spécifique.

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

S’applique à