Leer en inglés

Compartir vía


DataRow.SetParentRow Método

Definición

Establece la fila primaria de DataRow.

Sobrecargas

SetParentRow(DataRow)

Establece la fila primaria de un DataRow con un nuevo DataRow primario especificado.

SetParentRow(DataRow, DataRelation)

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

SetParentRow(DataRow)

Source:
DataRow.cs
Source:
DataRow.cs
Source:
DataRow.cs

Establece la fila primaria de un DataRow con un nuevo DataRow primario especificado.

C#
public void SetParentRow (System.Data.DataRow? parentRow);
C#
public void SetParentRow (System.Data.DataRow parentRow);

Parámetros

parentRow
DataRow

Nuevo DataRow primario.

Se aplica a

.NET 9 otras versiones
Producto Versiones
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

SetParentRow(DataRow, DataRelation)

Source:
DataRow.cs
Source:
DataRow.cs
Source:
DataRow.cs

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

C#
public void SetParentRow (System.Data.DataRow? parentRow, System.Data.DataRelation? relation);
C#
public void SetParentRow (System.Data.DataRow parentRow, System.Data.DataRelation relation);

Parámetros

parentRow
DataRow

Nuevo DataRow primario.

relation
DataRelation

Relación DataRelation que se va a utilizar.

Excepciones

Una de las filas no pertenece a una tabla.

Una de las filas es null.

La relación no pertenece a la colección DataRelationCollection del objeto DataSet.

El objeto DataTable secundario 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.

VB
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

.NET 9 otras versiones
Producto Versiones
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1