datareader vs dataset

G

Guest

hey all,

Regarding paging and sorting in a datagrid, is it better to:

A:
persist a dataset in session

or

B:
use a datareader as a datasource for my datagrid

or

C:
you know a better way than the above

thanks,
rodchar
 
S

Scott Allen

There are many more details to evaluate, really, like how much data
will be in the DataSet and how many users will you have.

The easiest solution, if you have the server resources, is to cache
the DataSet in the Cache object and use it for paging and sorting.
Paging and sorting with a data reader takes a lot more code and
testing.
 
G

Guest

would caching the dataset cause problems if you have many users using
application at the same time?

for example, i was caching a dataset and when many users from different
departments started using it in a training class everybody was seeing
information from all departments instead of just theirs.
 
S

Scott Allen

would caching the dataset cause problems if you have many users using
application at the same time?

for example, i was caching a dataset and when many users from different
departments started using it in a training class everybody was seeing
information from all departments instead of just theirs.

Not if you cache the objects properly. Keeping the cached DataSet
objects in Session would be one way to make sure they are only
available to a specific user.

The cache can be more useful since it provides more options for
managing the duration of the cached object, but since the cache has an
application wide scope you have to make sure you use a cache key that
scopes a cached piece of data to a specific user (if the data is
specific to a user).

Know what I mean?
 
G

Guest

Thank you very much for this insight.

Scott Allen said:
Not if you cache the objects properly. Keeping the cached DataSet
objects in Session would be one way to make sure they are only
available to a specific user.

The cache can be more useful since it provides more options for
managing the duration of the cached object, but since the cache has an
application wide scope you have to make sure you use a cache key that
scopes a cached piece of data to a specific user (if the data is
specific to a user).

Know what I mean?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top