从数据库中获取记录并将其显示在gridview中 [英] Fetch record from Database and display it into gridview
问题描述
详细信息来自数据库
用户名配置项目培训文档CodeChange Total疑难解答
Bhanu Goankar AFOTA 7 18 25
Bubai Banerjee AFOTA 7 16 23
总AFOTA 14 34 48
Bhanu Goankar一般38 2 40
Bubai Banerjee一般36 3 39
总计74 5 79
但我想用以下方式支持这个
配置AFOTA AFOTA总务
用户名文档CodeChange ProjectTraining故障排除总计
Bhanu Goankar 7 18 38 2 65
Bubai Banerjee 7 16 36 3 62
总计14 34 74 5 127
我使用的是Asp.net 4.0和Sqlserver 2008.我想要从数据库到gridview获取记录。我是这个系统中的新手(Freshers)。所以请帮助我。在此先感谢
Details are coming in this way from Database
UserName ConfigItem ProjectTraining Documentation Troubleshooting CodeChange Total
Bhanu Goankar AFOTA 7 18 25
Bubai Banerjee AFOTA 7 16 23
Total AFOTA 14 34 48
Bhanu Goankar GENERAL 38 2 40
Bubai Banerjee GENERAL 36 3 39
Total GENERAL 74 5 79
But I want it in this in this below way
ConfigItem AFOTA AFOTA GENERAL GENERAL
UserName Documentation CodeChange ProjectTraining Troubleshooting Total
Bhanu Goankar 7 18 38 2 65
Bubai Banerjee 7 16 36 3 62
Total 14 34 74 5 127
I am using Asp.net 4.0 and Sqlserver 2008. I want to fetch record from Database to gridview.I am very new in this system(Freshers). So please help me. Thanks in Advance
推荐答案
您好,
请查看以下文章。
在ASP中的GridView中将列显示为行.NET [ ^ ]
文章,作者使用,数据表的示例数据,但你可以修改为结果从您的存储过程或数据库查询。作者还使用了FlipFlopTable
函数,你必须根据你的显示结构进行修改。
希望它有所帮助。
Hi,
check the below article.
Display Columns as Rows in GridView in ASP.NET[^]
in the article, author used, sample data for datatable, but you can modify as the result from your stored procedure or database query. Author also used "FlipFlopTable
" function, there you have to modify according to the your display structure.
hope it helps.
http://www.aspdotnet-suresh.com/2013/01/convert-gridview-columns-to-rows-in.html [ ^] [ ^ ]
这篇关于从数据库中获取记录并将其显示在gridview中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!