如何将两个数据表合并到.net中的一个数据表中 [英] How to combind two datatables in to one datatable in .net

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

问题描述

Hai All,


我需要合并两个datatables.First表包含2列,第二个表包含3列,我需要在一个表中组合两者,结果应该这是可能的......?


谢谢,

Aswath。

Hai All,

I need to combind two datatables.First table contains 2 columns and 2nd table contains 3 columns, i need to combind both in one table, and the result should be in 5 columns.Is it possible...?


Thanks,
Aswath.

推荐答案

是的,这是可能的。

创建第三个表有所有5列并用两个表填充数据。
yes it is possible.
Create third table have all 5 columns and populate the data with both the tables.


你需要合并两个数据库或两个表?


BTW你正在使用的数据库是什么?
you need to combine two databases or two tables ?

BTW what is the database that you are using ?


Hai

谢谢重播,


我正在使用MS SQL Server。我从数据库中获取数据,在我后面的代码中使用两个数据表进行两个存储过程。最后我需要将两个数据表合并为一个和我希望结果是pyarlally即。

datatable1 --10行x 2列

datatable2 --10行x 3列


结果表:---- 10r ows x 5列是否可能.....?


谢谢,

Aswath。
Hai
Thanks for Replay,

Im using MS SQL Server.Im getting data from Database,In code behind im using two datatables for two stored procedures.finally i need to combind two datatables to one and i want the result in pyarlally ie.
datatable1 --10 rows x 2columns
datatable2 --10 rows x 3 columns

result table:---- 10rows x 5 columns is it possible.....?

Thanks,
Aswath.


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

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