473,503 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SqlDataReader Limitation?

Hi

Is there a limitation on how many rows can be fetched using a SqlDataReader
in ASP.Net 2.0 ?

--
Thanks,
SDRoy
Apr 27 '06 #1
3 1478
one?

Apr 27 '06 #2
Well, you can only read one at a time, which I assume is that the previous
poster was talking about...

But there's no built-in limitation. I imagine if you tried to receive a
billion rows something would go wrong. The real limitation is going to be
what you are storing the data into. I mean, if you discard the data via
something like:

while (dr.Read())
{
}

I imagine you could fetch an unlimited number of rows...
but if you are loading the data into something, like:

while(dr.Read())
{
users.Add(new User.CreateNewUser(dr));
}

you'll obviously eventually run out of memory because your user collection
is going to grow to be too much.

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"SDRoy" <SD***@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
Hi

Is there a limitation on how many rows can be fetched using a
SqlDataReader
in ASP.Net 2.0 ?

--
Thanks,
SDRoy

Apr 27 '06 #3
Thanks. Yes I am doing something like...

while (myReader.Read())
{
dr = dt.NewRow();
dr["fullname"] = Convert.ToString(myReader.GetValue(2));
dr["dob"] =
Convert.ToString(Convert.ToDateTime(myReader.GetVa lue(3)).ToShortDateString());
dr["description"] = Convert.ToString(myReader.GetValue(4));
dt.Rows.Add(dr);
}

Then,
GridView1.datasource=dt//dt is the datatable
GridView.DataBind().

I am seeing that my GridView doesn't show all the rows that have been
returned from the sql query...
How do I achieve this ?

Thanks

--
Thanks,
SDRoy
"Karl Seguin [MVP]" wrote:
Well, you can only read one at a time, which I assume is that the previous
poster was talking about...

But there's no built-in limitation. I imagine if you tried to receive a
billion rows something would go wrong. The real limitation is going to be
what you are storing the data into. I mean, if you discard the data via
something like:

while (dr.Read())
{
}

I imagine you could fetch an unlimited number of rows...
but if you are loading the data into something, like:

while(dr.Read())
{
users.Add(new User.CreateNewUser(dr));
}

you'll obviously eventually run out of memory because your user collection
is going to grow to be too much.

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"SDRoy" <SD***@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
Hi

Is there a limitation on how many rows can be fetched using a
SqlDataReader
in ASP.Net 2.0 ?

--
Thanks,
SDRoy


Apr 27 '06 #4

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

Similar topics

3
536
by: Ricola ! | last post by:
Why do I say: SqlDataReader dr; instead of SqlDataReader dr = new SqlDataReader();
7
2343
by: Franck Diastein | last post by:
Hi, when I call ExportData I have this error: Invalid attempt to Read when reader is closed. Telling me that there's a problem with this line: while(_dataR.Read()){ Code:...
3
5864
by: Neil Guyette | last post by:
Hello, Everyone, I'm trying to find information on how to populate a combo box using a SqlDataReader. I want to be able to set the value of the combo's value property different then the...
1
3244
by: Arvind P Rangan | last post by:
Hi All, How do you get all the values of a sqldatareader if it contains multiple resultset. Using sqldatareader.nextresult and sqldatareader.read e.g. While sqldatareader.read ' If not...
4
2877
by: Michael Carr | last post by:
I have a function that populates a class with values from a database. I'd like to pass into the function either a SqlDataReader or a DataRow, depending on which mechanism I'm using to retrieve data...
1
1419
by: me | last post by:
Why is SqlDataReader not present in visual studios Toolbox->Data where I find components like DataSet? Most examples in books and in vs.net are based on datasets but using disconnected tables seems...
8
2058
by: bidllc | last post by:
I have a funtion that works fine and dandy when called from anywhere in my app. It will NOT work when called from inside the class in which it resides. This is the function I'm calling:...
4
2356
by: mimi | last post by:
Hi Please help me out, I can't find a way to close a sqldatareader when error occur at statement cmd.ExecuteReader(). I can't close it in catch because it is local in try scope and I can't...
0
7074
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...
0
7322
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6982
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5572
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1501
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.