ds.Tables[0] is a reference to the first table in the collection of tables as part of the DataSet(ds) so this is a valid statement
var table = ds.Tables[0];
however DataTable does not have a member Row. It does have a member named Rows. This is a collection of all the rows in the table.
you can get an exact row in the table like this
var row = ds.Tables[0].Rows[x];
where x in the zero based index of the row you want.
if you want to know what row you are on you can loop through the rows.
var index = 0;
foreach(var row in table.Rows)
{
Console.WriteLine("the current row index is {0}", index++);
}
most times you shouldn't care what the row index is, you just want to find the row and continue processing.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.