将数据表中的行插入另一个数据表中 [英] insert Row from DataTable in Another DataTable
本文介绍了将数据表中的行插入另一个数据表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个大数据表,对其进行操作以对其进行过滤.
筛选过程完成后,我需要将接受我的条件的行插入到新数据表中,以供下一步使用.
现在我在执行该操作的语法方面存在问题.
那么,有什么需要帮忙吗?
谢谢
Hi all,
I have a big datatable which I make an operation on it to filter it.
After the filteration process, I need the row which accept my condition to be inserted in to a new datatable to be used next.
And now I have a problem with the syntax to do that.
So, any help please?
Thanks
推荐答案
如果使用DataTable.Select
过滤表,它将返回DataRow[]
以后,您可以使用DataTable.ImportRow
[
If you are filtering your table withDataTable.Select
, it will return theDataRow[]
Later you can useDataTable.ImportRow
[^]
foreach (DataRow row in rowArray) {
myDataTable.ImportRow(row);
}
这篇关于将数据表中的行插入另一个数据表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文