How to determine if the next line in a datatable is blank

In my datatable I am telling it to look at the next row Column 1 and see if that matches the current row Column 1. I have an error at the very last row in the datatable as there is not another one after it to compare. How do I code to know that the next line is blank???

You can use IsNothing in If Condition, if the condition is true continue; otherwise break:
example: IsNothing(dt.row(column1).toString).
Hope it helps.

Ganesh Dongre.

Use the index property of for each row. If the index is equal to yourTable.Rows.Count-1 then you’re on the last row.

That won’t work for determining if a For Each Row is on the last row of the datatable.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.