如何将ASP.net数据网格行显示为列,反之亦然? [英] Howto display an ASP.net datagrid rows as columns and vice versa?
本文介绍了如何将ASP.net数据网格行显示为列,反之亦然?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将ASP.net数据网格行显示为列,反之亦然?
我在数据库中有Table,如
名称城市年龄
xxx yyy zzz
我需要显示像
名称xxx
城市yyy
年龄zzz
在此先谢谢您....
How to display an ASP.net datagrid rows as columns and vice versa?
I have Table in database like
Name City Age
xxx yyy zzz
I need to display like
Name xxx
City yyy
Age zzz
Thanks in Advance....
推荐答案
您确定要使用GridView
吗?因为Repeater
就可以了.
问候,
爱德华(Eduard)
Are you sure you want to useGridView
? Because aRepeater
is fine with that.
Regards,
Eduard
您可以使用PIVOT
命令 [ ^ ]可以在行和列之间进行切换在查询本身中.
You can use the PIVOT
command[^] to switch between rows and columns in your query itself.
这篇关于如何将ASP.net数据网格行显示为列,反之亦然?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文