本文整理匯總了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