Reputation: 712
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?
Upvotes: 0
Views: 356
Reputation: 18379
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
Upvotes: 1