How do I get the index of the first blank row in an excel file that I’m reading into a data table?
I am able to return the index of a column “Status” that contains the value “New” with this formula:
io_TransactionData.Rows.IndexOf(io_TransactionData.AsEnumerable().Where(Function(row) row("Status").ToString.Trim = "New").ToList().First)
But I am having a hard time getting it to work when I try to convert it so that:
- It references the column by index rather than by name
- It returns only values that are blanks (would ideally like to use the string.isNullOrWhitespace function)
Can anyone please tell me what I’m doing wrong?
io_TransactionData.Rows.IndexOf(io_TransactionData.AsEnumerable().Where(Function(row) row(0).ToString.Trim = "").ToList().First)