Click here to Skip to main content
15,918,516 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have table which contains dynamic column i want that column to be viewd as rows and their corresponding values infront of them

how can i do it ??
i tried it with pivot but i am able to do it for limited column

othererwise tell me how can i show it on gridview instead of result
Posted
Comments
CHill60 12-Nov-13 14:34pm    
Try posting the code that you tried

It's quite often asked question. Please, follow below articles:
Using PIVOT and UNPIVOT[^]
Pivot tables in SQL Server. A simple sample[^]
T-SQL: Dynamic Pivot on Multiple Columns[^]
Simple Way To Use Pivot In SQL Query[^]
Working with Pivot and UnPivot Transformation[^]

Next time, please use SearchBox[^] on the right-top corner of this site.
 
Share this answer
 
Comments
Member 10202727 12-Nov-13 23:20pm    
Sir,
These are the examples which represents columns that have one column as static or one of the column is integer here i have all the columns as dynamic and i need to display it

i have record like this
col1 col2 col3
A B C

i want this as
col1 A
col2 B
col3 C
I didn't get the query but i tried to solve my problems using c#
I retrieve all the data in datatable and arrange these data as per my need..
Thank You
 
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