如何使用asp.net C#将一个数据表复制到另一个数据表中,给出了一个解决此问题的示例. [英] How to copy one Datatable to another datatable using asp.net C# give one example to solve this solution.

查看:86
本文介绍了如何使用asp.net C#将一个数据表复制到另一个数据表中,给出了一个解决此问题的示例.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


如何使用asp.net C#将一个数据表复制到另一个数据表 解决方案的示例.

Hi,
How to copy one Datatable to another datatable using asp.net C# give one
example to solve this solution.

推荐答案


检查此
您可以使用DataTable.Merge
http://asp-net-example. blogspot.com/2011/05/how-to-use-datatable-merge-method-in.html [ http://msdn.microsoft.com/en-us/library/fk68ew7b.aspx [ ^ ]
最好的问候
M.Mitwalli
Hi ,
Check this
You can use DataTable.Merge
http://asp-net-example.blogspot.com/2011/05/how-to-use-datatable-merge-method-in.html[^]
http://msdn.microsoft.com/en-us/library/fk68ew7b.aspx[^]
Best Regards
M.Mitwalli


DataTable dtNew=yourOldDL.Copy();//it will copy data and structure

DataTable dtNew=yourOldDL.Clone();//it will copy structure only



请尝试使用以下代码将一个表复制到另一个表.

Hi
Please try the following code for the copy one table to other.

DataTableNew = DataTableOld.Copy();



我希望您是在谈论.NET数据表,而不是数据库表.



I hope you are talking about the .NET datatable not the Database Tables.


这篇关于如何使用asp.net C#将一个数据表复制到另一个数据表中,给出了一个解决此问题的示例.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆