DataRow.SetParentRow Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
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)
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
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
- 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