DataRow.SetParentRow Método

Definición

Establece la fila primaria de .DataRow

Sobrecargas

Nombre Description
SetParentRow(DataRow)

Establece la fila primaria de un DataRow objeto con el nuevo elemento primario DataRowespecificado.

SetParentRow(DataRow, DataRelation)

Establece la fila primaria de un DataRow objeto con el nuevo elemento primario DataRow especificado y DataRelation.

SetParentRow(DataRow)

Establece la fila primaria de un DataRow objeto con el nuevo elemento primario DataRowespecificado.

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)

Parámetros

parentRow
DataRow

Nuevo elemento primario DataRow.

Se aplica a

SetParentRow(DataRow, DataRelation)

Establece la fila primaria de un DataRow objeto con el nuevo elemento primario DataRow especificado y 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)

Parámetros

parentRow
DataRow

Nuevo elemento primario DataRow.

relation
DataRelation

Relación DataRelation de uso.

Excepciones

Una de las filas no pertenece a una tabla

Una de las filas es null.

La relación no pertenece al DataRelationCollection del DataSet objeto .

El elemento secundario DataTable de la relación no es la tabla a la que pertenece esta fila.

Ejemplos

En el ejemplo siguiente se establece la fila primaria de una fila secundaria específica.

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

Se aplica a