Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Asp.Net Programming

Can I cache a DataTable in a Session object?


Can I cache a DataTable (or alternative GridView Datasource) in a
Session object?

... and does the following scenario present itself as an occaison when
I could get away with doing so?

In an Asp.Net 2.0 app. I have a search results page. The results are
diplayed in a GridView with paging and sorting. In would prefer to get
all the data and do the paging/sorting in memory rather than adding to
the complexity of the T-SQL. It's not so much the paging that bothers
me as the sorting (that would be awful - I'd have to put the raw
results in a table variable first, then query the table variable to
get the paged/sorted results).

On any one day there are only about 100 clients who would use this web-
site (not concurrently). The site shares a server with an even less
busy site.

Q1: Am I right in thinking that this data should not be cached in the
Data Cache because each client will have entirely different search
results. (For instance, if two clients use the search page at the same
time that will lead to inconsistenty. - as the second client's data is
cached in the same Cache object as the first.)

Q2: Will it be possible to cache the DataSource for the GridView as
Session object instead? (assuming the above problems with the Data
Cache)

Q3: If I cache in the Session, apart from destroying the session
object (i.e the cached data) on leaving the page - are there any other
major considerations?

Q4: Would the DataSource need to be serializable for it to be storeded
as a session object?.

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc