I need to convert Database rows into columns and show the result in Gridview. My DB is as follows:
ID Hotel cDate Price
-----------------------------------------------
1 Hotel1 12/22/2009 12:00:00 AM 15.0000
2 Hotel2 12/22/2009 12:00:00 AM 25.0000
3 Hotel3 12/22/2009 12:00:00 AM 60.0000
4 Hotel4 12/22/2009 12:00:00 AM 55.0000
.
.
.
I've to show the results as below:
cDate Hotel1 Hotel2 Hotel3 Hotel4
12/22/2009 12:00:00 PM 15 25 60 55
12/22/2009 12:00:00 AM .. .. .. ..
12/22/2009 12:00:00 AM
12/22/2009 12:00:00 AM
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…