ASP.NET provides a few methods of storing data:
ViewState - ie, in the page. Not good for a large amount of data
Cache - Application caching
Session - Per user caching
If you are paging small amounts of data, you can either pull it each trip or
cache in ViewState. Once you start getting more data, you will want to use
Cache or Session. Session is useful if the user is getting data you are
unlikely to pull for other users. If they are examining the same data sets,
you are better to use Cache.
A bit of info:
Caching:
http://www.eggheadcafe.com/articles/20060407.asp
Go down to caching application data for a code sample
More specific Caching implementation
Part I
http://geekswithblogs.net/ranganh/ar.../28/64260.aspx
Part II
http://geekswithblogs.net/ranganh/ar.../28/64300.aspx
ViewState - more an intro to how it works
http://msdn.microsoft.com/en-us/library/ms972976.aspx
Session - also general
http://msdn.microsoft.com/en-us/library/ms972429.aspx
In general, you load the data in one of two places:
1. Page_Load in a block where IsPostBack is false
2. After a form submit to pull data
Either way, you isolate this so this code is not run on every hit to the
page. If not, your paging will never work.
--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA
Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss
or just read it:
http://gregorybeamer.spaces.live.com/
*************************************************
| Think outside the box!
|
*************************************************
"Sobin Thomas" <so***@securesonic.comwrote in message
news:e2****************@TK2MSFTNGP05.phx.gbl...
Hi All.......
I am a beginner in asp.net.I need your help.I have a gridview control in
my Default.aspx page.I use data adapter to fill a datatable and then I set
the datasource of the gridview as the datatable.The datatable obtained is
a large one.I want this table to be in memory(I dont know how to),as I
have to use the same datatable for enabling paging in gridview.
In short,my problem is ,I need to store the datatable (which is filled by
the adapetr) somewhere temporarily for further use.How can I accomplish
this?
Hope You'll surely have the solution
Regards