【发布时间】:2015-10-24 17:16:59
【问题描述】:
我有一张有 2 列的表格
+------+------+
| Col1 | Col2 |
+------+------+
| 1000 | 2 |
| 1000 | 4 |
| 1001 | 6 |
| 1002 | 8 |
+------+------+
我正在尝试将当前行的数据行列值与 col1 中的前一个数据行列值进行比较,如果它们相同,则返回当前行的 col2 值
这是我的代码:
if myDataRow.Item("Col1") = preVal Then
id = myDataRow.Item("Col2").ToString()
end if
preVal = -1
preVal = myDataRow.Item("Col1").ToString
【问题讨论】:
标签: vb.net dataset comparison datarow