Try to replace
for (int i = j; i <= ds.Tables[0].Rows.Count; i++)
with
for (int i = j; i < ds.Tables[0].Rows.Count; i++)
With a 0 based list, the last element is Count-1
[Update]
Test if
ds.Tables[0].Rows[i].Count
is at lest 8 because you try to read element 7.
[Update]
Quote:
Compiler shows error as "Error 1 Operator '<=' cannot be applied to operands of type 'int' and 'method group'"
Looks like you try to access
ds.Tables[0].Rows
as a 2D array when it is in fact a 1D array.
ds.Tables[0].Rows[i][Fore]
do not exist because
ds.Tables[0].Rows[i]
is an int and
ds.Tables[0].Rows
is an array