473,497 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to get number of rows returned by a SqlDataReader?

how to get number of rows returned by a SqlDataReader without having to
scroll it?

Nov 16 '05 #1
3 14115
Juan,
I don't think you can. If you want that type of information you'll have
to use a DataSet instead. The performance of a SqlDataReader is better, but
if you need that type of information before you loop through the results, I
think you'll have to use a DataSet.

HTH

--
Lateralus [MCAD]
"Juan" <ju*****************@ANTISPAMhotmail.com> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl...
how to get number of rows returned by a SqlDataReader without having to
scroll it?

Nov 16 '05 #2
Thanks, needed a confirmation...

"Lateralus [MCAD]" <dnorm252_at_yahoo.com> escribió en el mensaje
news:ud**************@TK2MSFTNGP11.phx.gbl...
Juan,
I don't think you can. If you want that type of information you'll have to use a DataSet instead. The performance of a SqlDataReader is better, but if you need that type of information before you loop through the results, I think you'll have to use a DataSet.

HTH

--
Lateralus [MCAD]
"Juan" <ju*****************@ANTISPAMhotmail.com> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl...
how to get number of rows returned by a SqlDataReader without having to
scroll it?


Nov 16 '05 #3
Well, even the recordset doesn't know how many rows it
has in it until it reads the entire set, you just get a '-
1' returned until you go to the end of the dataset
forcing the entire dataset to be read.
-----Original Message-----
how to get number of rows returned by a SqlDataReader without having toscroll it?

Nov 16 '05 #4

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

Similar topics

7
12032
by: Egor Shipovalov | last post by:
I'm implementing paging through search results using cursors. Is there a better way to know total number of rows under a cursor than running a separate COUNT(*) query? I think PostgreSQL is bound...
0
5746
by: D. Dante Lorenso | last post by:
I need to know that original number of rows that WOULD have been returned by a SELECT statement if the LIMIT / OFFSET where not present in the statement. Is there a way to get this data from PG ?...
1
13405
by: BF | last post by:
Hello, I am trying to find out if there is a way to limit the number of rows returned when a cursor is opened. I am using DB2 version 7 on z/OS. The SELECT statement in my DECLARE CURSOR...
2
1562
by: Andrew | last post by:
Hey all, Have a strange one here, and being still fairly new to .NET isn't helping me understand it. I am having a problem where a DataReader doesn't return all the rows when I try to use a...
0
1097
by: JC | last post by:
Hi, I have a stored Proc being called from a a c# class that is passing a resulting datareader back to a windows form , to build a drop down. The really odd thing is, only a handfull of the...
4
1566
by: Ed | last post by:
I have a new requisite from a client that wants to give the user the option to about a databind based on number of returned rows. if ds.rows.count < 1000 then dg.databind() etc. They want...
4
14376
by: Chris Tremblay | last post by:
I am trying to figure out how to go about retrieving the number of results returned from my queries in SQL server from VB.NET without using a the Select Count(*) query. The method that I was using...
8
2665
by: Alec MacLean | last post by:
Hi, I'm using the DAAB Ent Lib (Jan 2006) for .NET 2.0, with VS 2005 Pro. My project is a Web app project (using the WAP add in). Background: I'm creating a survey system for our company, for...
2
4725
by: yuva17raj | last post by:
hi i am using the select query with group by, so that i am getting records with more than one column so that i need to calculate the number of rows returned by the query for example with my...
0
7162
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,...
0
7197
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
6881
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
7375
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
5456
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
4584
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
3088
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
1411
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 ...
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.