【发布时间】:2017-02-09 03:09:49
【问题描述】:
DataTable.Select 问题
我有这样的简单数据表
| 1 | 2 | 3 |
|------|------|------|
| 1966 | 6544 | 1967 |
| 9560 | 3339 | 4968 |
| 0 | 9400 | 1765 |
| 0 | 5479 | 6701 |
例如,我想检查“1”列中是否已经存在 1966,如果存在则获取行索引 我做这样的代码
Dim search() As DataRow = table.Select(" '" & i & "' = '" & value & "' ")
'where i is a integer from 1 to 3 and value is a biginteger
If search.Count > 0 Then
'get row index
Else
Console.WriteLine("not found")
End If
【问题讨论】: