P
pmanno
If I have a page with a DataGrid that is bound to a DataTable that is
populated by a query to a database and I want to enable sorting and
paging, do I have to add the DataTable to the cache or will the
viewstate hold the contents of the DataTable?
Basically, I want to avoid hitting the database wherever I can. It
seems that the DataTable has to be cached and the DataGrid re-bound, or
the DataTable has to be re-populated from the database and the DataGrid
re-bound whenever a postback occurs since the DataTable and therefore
the data which is bound to the grid is discarded once the page renders.
Thanks.
populated by a query to a database and I want to enable sorting and
paging, do I have to add the DataTable to the cache or will the
viewstate hold the contents of the DataTable?
Basically, I want to avoid hitting the database wherever I can. It
seems that the DataTable has to be cached and the DataGrid re-bound, or
the DataTable has to be re-populated from the database and the DataGrid
re-bound whenever a postback occurs since the DataTable and therefore
the data which is bound to the grid is discarded once the page renders.
Thanks.