0) You're using the same variable in both for loops. That is NOT going to give you the expected result.
1) You're hard coding the column number in your if statement instead of using the iterator.
Is this what you meant to do?
for(int j = 3; j <= columncountvalue; j++)
{
for (int i = 12; i <= rowcountvalue; i++)
{
if (string.IsNullOrEmpty(ds.Tables[s].Columns[j][i].ToString().Trim() ))
{
}
}
}
And by the way, if you run into a null value in your table, the code will throw an exception because you tried to call
ToString()
on a null reference.
Further, if you didn't subtract 1 from columncountvalue and rowcountvalue, you'll probably get an out-of range exception when it hits the end of the rows and or columns.
Finally, I would probably iterate rows before columns, but that's more a matter of style I suppose.