I have a problem to display a data from the database. I have 6 columns(EmpName, EmpID, AdminCode, Practice, Hours, FTE) in my table and I want to display that data as below
blankArea blankArea blankarea P1(PracticeName) P2 P3 EmpName EmpID AdminCode Hours FTE Hours FTE Hours FTE
A 1 Insurance 0.14 0.03 0.00 0.00 0.00 0.00 A 1 AllDocs 0.19 0.04 0.00 0.00 0.00 0.00 B 2 Insurance 0.52 0.11 1.18 0.25 0.00 0.00 B 2 Payments 1.18 0.35 0.00 0.00 0.00 0.00 C 3 Payments 1.31 0.00 0.00 0.00 0.00 0.00
It means all details are in my table practice name is also in table and I use sql server 2005. How can I display my data as above format. Practice name is display horizontally and two columns are generated automatically and fill those columns with Hours and FTE column data which is exist in database.
Is repeater or datalist suitable for this. If yes then how. Have you any code regarding this. Please help.
Thanks in advance
I would use a GridView and it’s RowCreated Event to generate the extra row in the header:
ASPX:
Codebehind(VB.Net):
If you need C#, you can convert it here.
This is the result: