如何在Gridview中显示多个表中的记录 [英] How to Display the records from more than one table in Gridview

查看:122
本文介绍了如何在Gridview中显示多个表中的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请尽快给出一些解决方案...

解决方案

在sql:

在Sql中使用联接获取值并将其与gridview绑定



检查这些以了解连接:

用SQL连接表 [ ^ ]

SQL连接的可视化表示 [ ^ ]





在Asp.net中:

使用 DataTable.Merge 方法将其与gridview合并并绑定



请参阅:

http:// m sdn.microsoft.com/en-us/library/system.data.datatable.merge%28v=vs.110%29.aspx [ ^ ]


< blockquote>参考

绑定数据从两个不同的表格到一个GridView。 [ ^ ]



http://www.daniweb.com/software-development/csharp/threads / 345380 / display-data-from-two-different-tables-into-a-single-datagrid-view [ ^ ]



http: //social.msdn.microsoft.com/Forums/en-US/f63f612f-20be-4bad-a91c-474396941800/display-dataset-data-in-gridview-from-multiple-data-tables?forum=adodotnetdataset [ ^ ]



http://forums.asp.net/t/1701879.aspx?+Using +单+ gridview +到+显示+数据+来自+不同+表+ [ ^ ]


pls give some solution asap...

解决方案

In sql:
Use Joins in Sql to get the values and bind it with gridview

Check these to know about joins:
Joining Tables in SQL[^]
Visual Representation of SQL Joins[^]


In Asp.net:
Use DataTable.Merge Method to merge and bind it with gridview

See this:
http://msdn.microsoft.com/en-us/library/system.data.datatable.merge%28v=vs.110%29.aspx[^]


Refer
binding data to one GridView from two different tables.[^]

http://www.daniweb.com/software-development/csharp/threads/345380/display-data-from-two-different-tables-into-a-single-datagrid-view[^]

http://social.msdn.microsoft.com/Forums/en-US/f63f612f-20be-4bad-a91c-474396941800/display-dataset-data-in-gridview-from-multiple-data-tables?forum=adodotnetdataset[^]

http://forums.asp.net/t/1701879.aspx?+Using+single+gridview+to+display+data+from+different+tables+[^]


这篇关于如何在Gridview中显示多个表中的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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