一个gridview中有4个表可能吗? [英] 4 tables in one gridview it's possible?
问题描述
我在我的项目中使用了58个表格我希望显示4个表格数据的单个数据网格视图一个无能为力的问题,在这4个表格中没有共同的字段......
我想要这个
表1:
姓名年龄地址
------- ----------------------
ravi 14 xxxxx
raj 58 xxxxx
。
。
。
。
。
------------------------------
Tabel 2:
薪资电子邮件ID
-------------------------- ----
20000 *********
58552 *********
。< br $>
。
。
现在显示表格1 - 年龄和表格2 - 一个数据网格中的薪水喜欢这个
--------------
年龄薪水|
------- ------- |
14 20000 |
58 58552 |
------------ ---
i using 58 tables in my project i want to display the 4tabels data's a single datagridview one impotent matter there are no common fields in that 4 tables...
I WANT LIKE THIS
Tabel 1:
Name Age Address
-----------------------------
ravi 14 xxxxx
raj 58 xxxxx
.
.
.
.
.
------------------------------
Tabel 2:
Salary Email-id
------------------------------
20000 *********
58552 *********
.
.
.
now display the tabel 1--Age and tabel 2--Salary in one datagridview like this
--------------
Age salary |
--------------|
14 20000 |
58 58552 |
---------------
推荐答案
根据您发布的内容,这些表之间根本没有任何关系。网格控件一次只显示来自单个表的数据,无论是来自单个表的SELECT还是SELECT / JOIN语句,它实际上是根据其他表中的数据构建临时表。
如果没有关系,就无法建立你想要展示的这个表。
From what you've posted, there is no relationships between these tables at all. The grid controls will only show data from a single table at a time, be it a SELECT from a single table or a SELECT/JOIN statement, which really builds a temporary table from data in other tables.
With no relationship, there is no way to build this table you want to show.
@Ravi - 这个要求令人费解。为什么要在单个数据网格中显示不相关的表。你不能在一个标签视图中(使用jQuery或AJAX)在一个屏幕上显示它吗?
@Ravi - The requirement is puzzling. Why do you want to display unrelated tables in a single datagrid. Can't you display this in a tabbed view (using jQuery or AJAX) in a single screen?
这篇关于一个gridview中有4个表可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!