您的位置:首页 > 其它

遍历 DataSet

2015-09-14 21:49 211 查看
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 />");
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: