如何将特定列数据从一个数据库复制到另一个数据库 [英] How to Copy Specific Column Data From One Datatable To Another
本文介绍了如何将特定列数据从一个数据库复制到另一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将数据表2列数据复制到数据表2
数据表1
年龄
身高
5
50
6
60
7
8
80
数据表2
年龄
重量
5
7
35
输出
年龄
身高
体重
5
50
6
60
NULL
7
$
$
8
80
NULL
I Want to copy Data-table 2 Column with data to data-table 2
data-table 1
Age
Height
5
50
6
60
7
70
8
80
data-table 2
Age
Weight
5
30
7
35
Output
Age
Height
Weight
5
50
30
6
60
NULL
7
70
50
8
80
NULL
推荐答案
复制整个数据表并删除特定的列
例如。
Copy the whole data table and remove the specific columns
e.g.
DataTable cpy;
cpy = original.Copy();
cpy.Columns.Remove("OrderName");
cpy.Columns.Remove("OrderDate");
这篇关于如何将特定列数据从一个数据库复制到另一个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文