I am looping through every row in a datatable:
foreach (DataRow row in dt.Rows) {}
I would like to get the index of the current row within the dt datatable. for example:
int index = dt.Rows[current row number]
How do i do this?
I am looping through every row in a datatable:
foreach (DataRow row in dt.Rows) {}
I would like to get the index of the current row within the dt datatable. for example:
int index = dt.Rows[current row number]
How do i do this?
You have two options here.
The individual row simply represents data, so it will not know what row it is located in.