473,386 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

datareader vs dataset

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

Nov 19 '05 #1
4 1571
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.

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Sat, 5 Nov 2005 18:32:04 -0800, "rodchar"
<ro*****@discussions.microsoft.com> wrote:
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


Nov 19 '05 #2
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.

"Scott Allen" wrote:
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.

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Sat, 5 Nov 2005 18:32:04 -0800, "rodchar"
<ro*****@discussions.microsoft.com> wrote:
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


Nov 19 '05 #3
On Sat, 5 Nov 2005 22:58:03 -0800, "rodchar"
<ro*****@discussions.microsoft.com> wrote:
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?

--
Scott
http://www.OdeToCode.com/blogs/scott/
Nov 19 '05 #4
Thank you very much for this insight.

"Scott Allen" wrote:
On Sat, 5 Nov 2005 22:58:03 -0800, "rodchar"
<ro*****@discussions.microsoft.com> wrote:
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?

--
Scott
http://www.OdeToCode.com/blogs/scott/

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Yasutaka Ito | last post by:
Hi, My friend had a little confusion about the working of DataReader after reading an article from MSDN. Following is a message from him... <!-- Message starts --> I was going thru DataReader...
1
by: Rob via .NET 247 | last post by:
Ok, I'm new to .NET so I'm afraid I'm doing something stupidhere, but I'm trying to populate a DataSet manually from aDataReader, and its turning out to be ridiculously difficult. Yes, I could use...
5
by: Jason Huang | last post by:
Hi, Is it possible to bind DataReader to a DataGrid in C# windows form? And how? And can we update data in a DataSet by using the DataReader? Thanks for help. Jason
14
by: Bihn | last post by:
I was reading about datareader which is said to be slimmer & faster then dataset. Since the datareader have to go fetching the dat from the database every time it need it, the data it gets then...
2
by: Patreek | last post by:
Hi, I'm writing my first real asp.net app at my job, and I'd like opinions please. In my classic ASP apps that I've written, I'd often have separate files for retreiving data and returning the...
1
by: Ivan Weiss | last post by:
Hey all, I have the following code to populate a ListView control from my Access database. The listview is displaying a list of saved projects that the user will be able to open, edit, or delete...
2
by: SQL | last post by:
Hi, is there a method to move to the next record in a datareader? Kind of like the rs.MoveNext from VB6... Thanks
3
by: jason | last post by:
Hi, {asp .net 1.1, sp 2) I am facing problems with multi users accessing the same page. There is a datagrid in the webform. The "datareader already opened error/ object reference not found"...
7
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I have read some articles state that DataSet should NOT be used for large resultset. What does "large" mean? Is "large" based on # of rows/columns and/or memory required to hold the original and...
4
by: Chris | last post by:
Hi, i use this to recover data via a stored procedure from a database. Imports System.Data Imports System.Data.SqlClient Public Class chat Public Shared Function myfunction() As DataSet Dim...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.