本文整理匯總了VB.NET中System.Data.DataRowCollection.Find方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET DataRowCollection.Find方法的具體用法?VB.NET DataRowCollection.Find怎麽用?VB.NET DataRowCollection.Find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Data.DataRowCollection
的用法示例。
在下文中一共展示了DataRowCollection.Find方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: FindInMultiPKey
Private Sub FindInMultiPKey(ByVal table As DataTable)
' Create an array for the key values to find.
Dim findTheseVals(2) As Object
' Set the values of the keys to find.
findTheseVals(0) = "John"
findTheseVals(1) = "Smith"
findTheseVals(2) = "5 Main St."
Dim foundRow As DataRow = table.Rows.Find(findTheseVals)
' Display column 1 of the found row.
If Not (foundRow Is Nothing) Then
Console.WriteLine(foundRow(1).ToString())
End If
End Sub
示例2: FindInPrimaryKeyColumn
Private Sub FindInPrimaryKeyColumn(ByVal table As DataTable, _
ByVal pkValue As Long)
' Find the number pkValue in the primary key
' column of the table.
Dim foundRow As DataRow = table.Rows.Find(pkValue)
' Print the value of column 1 of the found row.
If Not (foundRow Is Nothing) Then
Console.WriteLine(foundRow(1).ToString())
End If
End Sub