I had a reason to loop through a dataset today and I was just wondering someone could be in need of this. I believe it is straight forward.
I am assuming here that you have already created your dataset (ds).
foreach (DataRow dr in ds.Tables[0].Rows)
{
//Do whatever you like here with the rows returned
Response.write(dr["columname"].ToString());
}
I am assuming here that you have already created your dataset (ds).
foreach (DataRow dr in ds.Tables[0].Rows)
{
//Do whatever you like here with the rows returned
Response.write(dr["columname"].ToString());
}
Comments