int x;
int iHateDataRows = dt.Rows.Count + 2;
System.Data.DataRow[] dra = new System.Data.DataRow[1000];
for(x = 0; x < iHateDataRows; ++x)
So, this is obviously a loop but, my problem is that the ++x tells me that it is unreachable. I don’t know if this is just my IDE going crazy or something (I use SharpDevelop, mostly because VS2008 is too clunky and doesn’t have neat little features that I like.)
I hope I provided enough info for someone to guess at the problem. I have stared at this thing, changed the variables. Everything, it won’t budge.
EDIT:
This is after the for loop:
if(dra[x].ItemArray[2].ToString() == "0")
{
return x.ToString();
}
else
{
return "Fail";
}
I sure hope this code is correct as I never got to test it.
You are always returning from the loop before it goes to the next iteration. That is, both halves of the “if” statement return. You never go back to the top of the loop.