如何在转发器控件中显示多表格值 [英] How to display multipal tables value in repeater control
本文介绍了如何在转发器控件中显示多表格值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在一个转发器控件中显示两个表数据。
第一张表:
Id
名称
状态
第二张桌子:
SNo
Id(第一张桌子钥匙)
Desc
状态
i想要展示
Sno:名称:desc
在一个转发器中。
How to display two tables data in one repeater control.
First Table:
Id
Name
Status
Second Table:
SNo
Id (FIRST tables Key)
Desc
Status
i want to display
Sno : name : desc
in one repeater.
推荐答案
问题是转发器只能绑定到一个数据源作为单个DataTable 。如果他的数据来自数据库,我建议将结果压缩到一个结果集中,这样你就有了一个DataTable。如果你无法做到这一点,你需要手动将两组数据加入一个DataTable。
这是一个帮助的链接:
http://social.msdn.microsoft.com/Forums/en-US/f122d7f4-3b7d-4d93-bd0f-8bb57cd990a4/how-to-join-two-datatables-使用-c-no-database-access [ ^ ]
The issue is that a repeater can only be bound to one data source being a single DataTable. If he data is coming from a database, I would suggest condensing the results into a single result set so you have one DataTable. If you are not able to do that, you will need to join the two sets of data into a single DataTable manually.
Here is a link to help with that:
http://social.msdn.microsoft.com/Forums/en-US/f122d7f4-3b7d-4d93-bd0f-8bb57cd990a4/how-to-join-two-datatables-using-c-no-database-access[^]
这篇关于如何在转发器控件中显示多表格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文