Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
2.00/5 (3 votes)
See more:
I want to display the records in grid or data list or repeater like this

C#
Name         xyz   abc   asd   pqr rst
Address      12a   321b 43c   43d 43e
salary      100   200   300   400 500


plz please help me out this.
Posted
Updated 11-Dec-11 18:09pm
v2
Comments
ramsagar nautiyal 12-Dec-11 0:18am    
how to create a login page with sql
Code 89 12-Dec-11 1:57am    
elaborate your question..
Code 89 12-Dec-11 1:59am    
@ram:Give ans for above Q,don't ask diff question

Use Pivot tables For this type of alignment.
 
Share this answer
 
So you need to arrange gridview in horizontal manner, create datatable and then bind it to GridView.

Displaying vertical rows in a DataGrid[^]
 
Share this answer
 
Try this...

Click
 
Share this answer
 
Hi,

Assuming you are using sql server....

Try Pivot query in sql server and get th data in the above required format and bind it.

For pivot in sql server have a look on the following links







http://blog.sqlauthority.com/2008/06/07/sql-server-pivot-and-unpivot-table-examples/[^]


http://msdn.microsoft.com/en-us/library/ms177410.aspx[^]



Hope this helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900