遍历 DataSet

DataSet ds=new DataSet ;
//获取dataset的第一张table,取其他table只须改下标
DataTable dt=ds.tables[0];
//遍历行
foreach(datarow dr in dt.rows)
{
//遍历列
for(int i=0;i<dt.columns.count;i++)
{
response.write(dr[i].tostring();
}
response.write("<br />");
}
原文地址:https://www.cnblogs.com/qigege/p/4808304.html