I have data in a data table which contains empty rows too and I want to loop through the table.
I noticed that foreach will not count the empty rows, so it doesn’t go until the last row.
So if the table has 10 records and 4 of them are empty, foreach will stop at the 6th row.
It would be easy to use a filter to delete all empty rows, however the position of data (row number) is important so I need to keep it that way.
Therefore, I would like to replace all the empty rows with a string (say, “Empty row”), so that foreach will count these rows too.
Is there a more elegant solution than using while with a counter starting from rows number and going to zero?