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,113
  • 2
  • 26
  • 36
Rajkumar Vasan
  • 712
  • 1
  • 9
  • 22

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
  • 18,029
  • 7
  • 45
  • 66