473,625 Members | 3,329 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 1483
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.CreateNewU ser(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***@discussi ons.microsoft.c om> wrote in message
news:9C******** *************** ***********@mic rosoft.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.ToStrin g(myReader.GetV alue(2));
dr["dob"] =
Convert.ToStrin g(Convert.ToDat eTime(myReader. GetValue(3)).To ShortDateString ());
dr["descriptio n"] = Convert.ToStrin g(myReader.GetV alue(4));
dt.Rows.Add(dr) ;
}

Then,
GridView1.datas ource=dt//dt is the datatable
GridView.DataBi nd().

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.CreateNewU ser(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***@discussi ons.microsoft.c om> wrote in message
news:9C******** *************** ***********@mic rosoft.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
2356
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: ************************************************* public void Export2CSV(){
3
5879
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 combo's text property (what the user will see). Is this possible with a SqlDataReader? Thanks
1
3251
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 sqldatareader then sqldatareader.nextresult
4
2888
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 from the database. However, the two classes don't appear to have any common interfaces that would allow me to enumerate the fields. Yet, when you databind you can pass either of these classes (as well as many others) and .NET somehow knows how...
1
1425
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 a bit heavyweight for most purposes. I there some particular reason to stay away from sqldatareader?? I have managed to bind components using sqldatareader but digging up the information was quite hard.
8
2070
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: "getProductByID(productID)" from inside another method in the same class. See below. This line throws a null ref exception: While dr.Read() Thanks for any insight!
4
2359
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 declare it outside try scope either since we have to call cmd.executeReader to create sqldatareader public string GetLogs(int logID) {
0
8256
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8694
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8356
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7184
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6118
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2621
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 we have to send another system
2
1500
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.