如何为每个循环使用多个数据表 [英] how to loop multiple data tables using for each loop
本文介绍了如何为每个循环使用多个数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我的项目有要求......即。我必须循环两个数据表....
我怎样才能循环使用....
请帮助...
谢谢,
代码中心。
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)
{
//-----
}
这篇关于如何为每个循环使用多个数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文