一个gridview中的两个表 [英] two tables in one gridview
本文介绍了一个gridview中的两个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在一个网格中添加两个不同的表,以便使用存储过程获取这些表?
how add two different tables in one grid i''m getting those tables using stored procedure?
推荐答案
用并集连接2个表:
Join the 2 tables with a union:
select Column1, Column2 from Table1
union
select Column1, Column2 from Table2
您将需要进行排序,并确保两个表的列数均相同.
您可以将虚拟列添加到具有较少列的表中,如下所示:
You''ll need to take care of sorting and making sure that both tables have the same number of columns.
You can add dummy columns to the table with fewer columns as:
select Column1, null from Table2
这篇关于一个gridview中的两个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文