我们如何将2个数据表合并为一个 [英] how we can concate 2 datatable into one

查看:112
本文介绍了我们如何将2个数据表合并为一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai All,



我们如何将两个数据表组合成一个,两个字段都是相同的类型,即name&数字字段是字符串类型。

即table1 + table 2 = table3;

table1包含字段名称作为名称

和table2包含字段名称as号码

但我需要table3作为名称,号码。请参阅下面的图片..





参考此图片 http://snag.gy/jshtM.jpg [ ^ ]

Hai All,

How we can combine two datatable into one, both fields are same type ie, name & number fields are string type.
ie table1 + table 2 = table3;
table1 contain field name as name
and table2 contain field name as number
but i need table3 as name, number. plz refer the image below..


refer this image http://snag.gy/jshtM.jpg[^]

推荐答案

使用datatable.merge(//其他数据表)..
use datatable.merge(//other datatable)..


别告诉我们迫切的是你不能做你的工作。



根据表格的含义,你可以在SQL中连接表,你可以将数据从一个表复制到另一个表,或者你可以创建包含两个表中数据的对象集合。
Don''t tell us that it''s urgent that you can''t do your job.

Depending on what you mean by ''table'', you can join tables in SQL, you can copy data from one table to another, or you can just create a collection of objects that includes the data from both tables.


创建一个包含两列的新表,然后从其他表中获取值。
Create a new table that contains two columns ,then get the value from the other tables .


这篇关于我们如何将2个数据表合并为一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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