0

I am converting the Rows as Columns using PIVOT in SQL Server. Keeping the result set in a DataTable and binding the DataTable with a GridView. As I want to generate the Column Dynamically based on the Rows, I am using PIVOT operation. How do I proceed if i don't want to use DataTable and want to use a ViewModel in place of DataTable?

Waqar Janjua
  • 6,073
  • 2
  • 24
  • 36
Rajkumar Vasan
  • 682
  • 1
  • 8
  • 21

1 Answers1

1

I've asked this question before but for winforms. I too had to pivot sql data. The answer was to make use of System.ComponentModel.

See top answer here: Data binding dynamic data

Community
  • 1
  • 1
Chris Moutray
  • 17,529
  • 7
  • 44
  • 65