如何为每个循环使用多个数据表
问题描述:
大家好,
我的项目有要求......即。我必须循环两个数据表....
我怎样才能循环使用....
请帮助...
谢谢,
代码中心。
Hi All,
I have on requirement in my project...i.e. i have to loop two data tables ....
how can i loop using for each....
Please help...
Thanks,
Code hub.
答
如果您有两个数据表,那么您可以按如下方式遍历此表
If you have two datatable then you can loop through this table as follow
DataSet ds=new DataSet();
//Now you add your table in this dataset
foreach(DataTable dt in ds.Tables)
{
//-----
}