将DataTable中的一行复制到另一个DataTable的方法
更新时间:2007年09月10日 21:42:10 作者:
将DataTable中的一行复制到另一个DataTable
方法1:
DataRow dr = ds2.Tables[0].NewRow();
dr.ItemArray = ds1.Tables[0].Rows[i].ItemArray;
ds2.Tables[0].Rows.Add( dr );
方法2:
ds2.Tables[0].ImportRow(ds1.Tables[0].Rows[i]);
方法1:
DataRow dr = ds2.Tables[0].NewRow();
dr.ItemArray = ds1.Tables[0].Rows[i].ItemArray;
ds2.Tables[0].Rows.Add( dr );
方法2:
ds2.Tables[0].ImportRow(ds1.Tables[0].Rows[i]);
相关文章
ASP.NET MVC中为DropDownListFor设置选中项的方法
这篇文章主要介绍了ASP.NET MVC中为DropDownListFor设置选中项的方法,需要的朋友可以参考下2014-10-10
Asp.Net Core中创建多DbContext并迁移到数据库的步骤
这篇文章主要介绍了Asp.Net Core中创建多DbContext并迁移到数据库的步骤,帮助大家更好的理解和学习使用Asp.Net Core,感兴趣的朋友可以了解下2021-03-03


最新评论