G
Guest
Hi All,
I am iterating through the rows in a table through foreach statement. I am
using DataRow object here to store the row from the DataRow collection.
Within the loop I need to find out the current row number. I could have used
an integer variable outside the loop and used it as counter. I wanted to know
if there is any better way of doing it, perhaps using some properties of
DataRow object itself.
foreach (DataRow row in dataset.Tables[0].Rows)
{
//I want to find the current row number here;
}
Thanks
pradeep
I am iterating through the rows in a table through foreach statement. I am
using DataRow object here to store the row from the DataRow collection.
Within the loop I need to find out the current row number. I could have used
an integer variable outside the loop and used it as counter. I wanted to know
if there is any better way of doing it, perhaps using some properties of
DataRow object itself.
foreach (DataRow row in dataset.Tables[0].Rows)
{
//I want to find the current row number here;
}
Thanks
pradeep