本文整理汇总了VB.NET中System.Data.DataRow.GetParentRow方法的典型用法代码示例。如果您正苦于以下问题:VB.NET DataRow.GetParentRow方法的具体用法?VB.NET DataRow.GetParentRow怎么用?VB.NET DataRow.GetParentRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.DataRow
的用法示例。
在下文中一共展示了DataRow.GetParentRow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: CallGetParentRowForTable
Private Sub GetParentRowForTable _
(thisTable As DataTable, relation As DataRelation)
If thisTable Is Nothing Then
Return
End If
' For each row in the table, print column 1
' of the parent DataRow.
Dim parentRow As DataRow
Dim row As DataRow
For Each row In thisTable.Rows
parentRow = row.GetParentRow(relation)
Console.Write(ControlChars.Tab & " child row: " _
& row(1).ToString())
Console.Write(ControlChars.Tab & " parent row: " _
& parentRow(1).ToString() & ControlChars.Cr)
Next row
End Sub
Private Sub CallGetParentRowForTable()
' An example of calling the function.
Dim thisTable As DataTable = DataSet1.Tables("Products")
Dim relation As DataRelation = thisTable.ParentRelations(0)
GetParentRowForTable(thisTable, relation)
End Sub
示例2: GetParentRowForTable
Private Sub GetParentRowForTable( _
thisTable As DataTable, relation As String)
If thisTable Is Nothing Then
Return
End If
' For each row in the table, print column 1
' of the parent DataRow.
Dim parentRow As DataRow
Dim row As DataRow
For Each row In thisTable.Rows
parentRow = row.GetParentRow(relation)
Console.Write(ControlChars.Tab + " child row: " _
+ row(1).ToString())
Console.Write(ControlChars.Tab + " parent row: " _
+ parentRow(1).ToString() + ControlChars.Cr)
Next row
End Sub
Private Sub CallGetParentRowForTable()
' An example of calling the function.
Dim thisTable As DataTable = DataSet1.Tables("Products")
Dim relation As DataRelation = thisTable.ParentRelations(0)
GetParentRowForTable(thisTable, relation.RelationName)
End Sub
示例3: CallGetParentRowForTable
Private Sub GetParentRowForTable _
(thisTable As DataTable, relation As DataRelation, _
version As DataRowVersion)
If thisTable Is Nothing Then
Return
End If
' For each row in the table, print column 1
' of the parent DataRow.
Dim parentRow As DataRow
Dim row As DataRow
For Each row In thisTable.Rows
parentRow = row.GetParentRow(relation, version)
Console.Write(ControlChars.Tab & " child row: " & _
row(1).ToString())
Console.Write(ControlChars.Tab & " parent row: " _
& parentRow(1).ToString() & ControlChars.Cr)
Next row
End Sub
Private Sub CallGetParentRowForTable()
' An example of calling the function.
Dim thisTable As DataTable = DataSet1.Tables("Products")
Dim relation As DataRelation = thisTable.ParentRelations(0)
' Print only original versions of parent rows.
GetParentRowForTable(thisTable, relation, _
DataRowVersion.Original)
End Sub
示例4: CallGetParentRowForTable
Private Sub GetParentRowForTable _
(thisTable As DataTable, relation As String, _
version As DataRowVersion)
If thisTable Is Nothing Then
Return
End If
' For each row in the table, print column 1
' of the parent DataRow.
Dim parentRow As DataRow
Dim row As DataRow
For Each row In thisTable.Rows
parentRow = row.GetParentRow(relation, version)
Console.Write(ControlChars.Tab & " child row: " _
& row(1).ToString())
Console.Write(ControlChars.Tab & " parent row: " _
& parentRow(1).ToString() & ControlChars.Cr)
Next row
End Sub
Private Sub CallGetParentRowForTable()
' An example of calling the function.
Dim thisTable As DataTable = DataSet1.Tables("Products")
Dim relation As DataRelation = thisTable.ParentRelations(0)
' Print only original versions of parent rows.
GetParentRowForTable(thisTable, relation.RelationName, _
DataRowVersion.Original)
End Sub