sourcelink
asked on
Pivot datatable for GridView and Update
Hello, I have seen several articles on Pivoting data in a datatable to bind to a data grid. Im using the one referenced in this link:
http://geekswithblogs.net/dotNETvinz/archive/2009/05/10/pivot-data-in-gridview---a-generic-pivot-method-with.aspx
I have the 2 datatables as in the example.
The original normalized version 'dt' with a sqldataadapter.
and the pivoted version 'pivotedTable' as the datasource for the gridview.
I would like to save the data modified in the gridview back to the database in its normalize form. Possibly using the 'dt' datatable and dataadapter.
My thoughts are:
use 'getchanges' from pivotedTable:
Dim changedRecords As System.Data.DataTable
changedRecords = dt.GetChanges
Then use 'changedrecords' datatable to update the original dt, and da.update to update the database.
My question is: is this a reasonable approach?, is there a better way?. Does someone have an example.
Im using winforms and vb.net but c++ is ok also.
thanks very much.
http://geekswithblogs.net/dotNETvinz/archive/2009/05/10/pivot-data-in-gridview---a-generic-pivot-method-with.aspx
I have the 2 datatables as in the example.
The original normalized version 'dt' with a sqldataadapter.
and the pivoted version 'pivotedTable' as the datasource for the gridview.
I would like to save the data modified in the gridview back to the database in its normalize form. Possibly using the 'dt' datatable and dataadapter.
My thoughts are:
use 'getchanges' from pivotedTable:
Dim changedRecords As System.Data.DataTable
changedRecords = dt.GetChanges
Then use 'changedrecords' datatable to update the original dt, and da.update to update the database.
My question is: is this a reasonable approach?, is there a better way?. Does someone have an example.
Im using winforms and vb.net but c++ is ok also.
thanks very much.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER