数据表 - 如何查看下几行?

时间:2014-04-18 19:25:42

标签: asp.net vb.net

我有一个我正在循环的数据表...

 For Each drIndicator As DataRow In dtIndicatorsToProcess.Rows

有没有办法去偷看"在接下来的几行确定一些事情然后继续?

谢谢!

1 个答案:

答案 0 :(得分:2)

你应该使用for循环,如下所示的东西应该合适

    For i = 0 To dtIndicatorsToProcess.Rows.Count - 1
        Dim drIndicator As DataRow = dtIndicatorsToProcess.Rows(i)
        '// Check ahead 2 rows
        Dim drRowToCheck As DataRow = dtIndicatorsToProcess(i + 2)

        '// Process here
    Next