如何将2个随机数据表合并为一个并在gridview中显示 [英] How to Merge 2 random datatables into one and display it in gridview

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

问题描述

嗨朋友我可以帮助我将2个随机表合并为一个并在gridview中显示

例如

表1

Sid SName Dno




桌子2

Dno Dname Daddress



i想合并&在datagridview中将这两个表显示为一个表如下


Sid SName Dno Dname Daddress


请帮帮我

我编写的程序是这样的

尝试改变它以便退出


Hi friends i can any one help me merging 2 random tables into one and displaying in gridview
for example
table 1
Sid SName Dno

and
table 2
Dno Dname Daddress


i want to Merge & display these 2 tables as one table in datagridview as following


Sid SName Dno Dname Daddress

please Help me

the program which i wrote till is like this
try to change it to get out put


展开 | 选择 | Wrap | 行号

推荐答案

你想做什么?


你的代码没有对我有意义。我无法想象它的工作原理。


请查看 DataTable类


请查看 DataTable.Merge方法

请记住,在每个页面请求完成处理后,您的表将被销毁。这意味着表格不可用于下一页请求,除非您重新创建它们或从某种缓存存储中检索它们。
What are you trying to do?

Your code doesn''t make sense to me. I can''t imagine it working at all.

Please take a look a the API for the DataTable class.

Please take a look at DataTable.Merge Method as well.

Please keep in mind that your Tables are going to be destroyed after every page request has finished processing. This means that the Tables won''t be available to the next page request unless you either recreate them or retrieve them from some sort of cache store.


此代码实际上用于Windows编程

button5_Click是用于创建2个数据表的代码从TextBoxes获取输入以设置列名称动态地


button1_Click用于将数据添加到第一个表中文本框作为输入


button2_Click用于将文本boix中的数据添加到第二个表作为输入


button3_Click用于将这些数据绑定到DATA GRID查看


okayif它如此令人困惑

你能不能写出新的程序来获得Out put
this code is actually for windows programming
button5_Click is code for creating 2 Data Tables Getting input from TextBoxes to Set column names Dynamically


button1_Click is for adding Data to the First table from text boxes as input

button2_Click is for adding data to second table from text boixes as input

button3_Click is for binding those data to DATA GRID VIEW

okayif its so confusing
can you please write fresh programe for getting Out put


你在开发一个ASP.NET应用程序(使用GridView)





您正在开发桌面应用程序(应该使用DataGridView)


???
Are you developing an ASP.NET application (that uses a GridView)

Or

Are you developing a desktop application (that should be using a DataGridView)

???


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

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