.NET Framework Class Library DataRow..::.SetParentRow Method (DataRow, DataRelation)
Namespace:
System.Data
Assembly:
System.Data (in System.Data.dll)

Syntax
Public Sub SetParentRow ( _
parentRow As DataRow, _
relation As DataRelation _
)
public void SetParentRow(
DataRow parentRow,
DataRelation relation
)
public:
void SetParentRow(
DataRow^ parentRow,
DataRelation^ relation
)
member SetParentRow :
parentRow:DataRow *
relation:DataRelation -> unit

Exceptions

Examples
The following example sets the parent row of a specific child row.
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

Version Information
.NET FrameworkSupported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0 .NET Framework Client ProfileSupported in: 4, 3.5 SP1

Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

See Also
|
Biblioteca de clases de .NET Framework DataRow..::.SetParentRow (Método) (DataRow, DataRelation)
Espacio de nombres:
System.Data
Ensamblado:
System.Data (en System.Data.dll)

Sintaxis
Public Sub SetParentRow ( _
parentRow As DataRow, _
relation As DataRelation _
)
public void SetParentRow(
DataRow parentRow,
DataRelation relation
)
public:
void SetParentRow(
DataRow^ parentRow,
DataRelation^ relation
)
member SetParentRow :
parentRow:DataRow *
relation:DataRelation -> unit

Excepciones

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

Información de versión
.NET FrameworkCompatible con: 4, 3.5, 3.0, 2.0, 1.1, 1.0 .NET Framework Client ProfileCompatible con: 4, 3.5 SP1

Plataformas
Windows 7, Windows Vista SP1 o posterior, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (no se admite Server Core), Windows Server 2008 R2 (se admite Server Core con SP1 o posterior), Windows Server 2003 SP2
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Vea también
|