Public Function ExistsRows(dtRow As DataTable, strID As String) As Boolean
For Each line As DataRow In dtRow.Rows
If strID = line(0).ToString() Then
Return True
End If
Next
Return False
End Function
Code (VB.NET)
Dim t As New DataTable
....
....
Dim drs() As DataRow
drs = t.Select("PK=5")
If drs.length>0 Then
' This block will be executed if there is PK=5 in datatable 't'
End If