I'm using the following code to count the number of rows in an html table, store that number to use in a for loop which extracts text out of a <td>
in each row.
Table myTable = browser.Div(Find.ById("resultSpan")).Table(Find.First());
int numRows = myTable.TableRows.Count;
List<string> myList = new List<string>();
for (int i = 1; i < numRows; i++)
{
myList.Add(myTable.TableRows[i].TableCells[1].Text);
}
I placed a label
control on my form and I basically want it to increment in real time so I can see how fast the program is parsing the data.
On average I'm dealing with ~2000 rows, so it takes a long time, and I want to be able to see the status. The above code is using WatiN, but I'm sure this is a C# question.
Edit This was easier than I thought-
for (int i = 1; i < numRows; i++)
{
myList.Add(myTable.TableRows[i].TableCells[1].Text);
label1.Text = i.ToString();
}