|
 |
aspx_beginners thread: PageCount?
Message #1 by "Paul Riley" <rilez@t...> on Tue, 29 Oct 2002 12:09:56 -0000
|
|
I have recently started developing in aspx from asp. I used the use the
pagecount of a recordset to return the total number of records returned.
I cannot see how to do this in aspx without selecting a count and then
selecting the actual records which is of course inefficient. Anyone
point me in the correct direction :O)?
Message #2 by Simon Hargreaves <simon.hargreaves@r...> on Tue, 29 Oct 2002 12:27:22 -0000
|
|
Paul,
If i understand what you want correctly, and you are using a dataset. Its a
bit distant in my memory now but I think something like
MyDataset.MyTableName.RecordCount
Should work.
Simon
-----Original Message-----
From: Paul Riley [mailto:rilez@t...]
Sent: 29 October 2002 12:10
To: aspx_beginners
Subject: [aspx_beginners] PageCount?
I have recently started developing in aspx from asp. I used the use the
pagecount of a recordset to return the total number of records returned.
I cannot see how to do this in aspx without selecting a count and then
selecting the actual records which is of course inefficient. Anyone
point me in the correct direction :O)?
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
Message #3 by "Paul Riley" <rilez@t...> on Tue, 29 Oct 2002 12:46:30 -0000
|
|
I'm actually using a datareader as the records are stored in a query.
-----Original Message-----
From: Simon Hargreaves
[mailto:simon.hargreaves@r...]
Sent: 29 October 2002 12:27
To: aspx_beginners
Subject: [aspx_beginners] RE: PageCount?
Paul,
If i understand what you want correctly, and you are using a dataset.
Its a
bit distant in my memory now but I think something like
MyDataset.MyTableName.RecordCount
Should work.
Simon
-----Original Message-----
From: Paul Riley [mailto:rilez@t...]
Sent: 29 October 2002 12:10
To: aspx_beginners
Subject: [aspx_beginners] PageCount?
I have recently started developing in aspx from asp. I used the use the
pagecount of a recordset to return the total number of records returned.
I cannot see how to do this in aspx without selecting a count and then
selecting the actual records which is of course inefficient. Anyone
point me in the correct direction :O)?
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
Message #4 by Simon Hargreaves <simon.hargreaves@r...> on Tue, 29 Oct 2002 13:38:23 -0000
|
|
Paul,
A datareader, from my memory, is for reading a text based data file. A
recordcount being more of a recordset (Database) property.
One way of dealing with your problem (And there are probably better ones !
:o)) is to use the datareader's peek method which looks ahead one line to
discover if there's anything there and can be made to return true or false,
combined with a 'MylineCount++' loop would populate a variable with your
linecount. I don't remember ever using something line a
MyDataReader.linecount.
HTH
S
-----Original Message-----
From: Paul Riley [mailto:rilez@t...]
Sent: 29 October 2002 12:47
To: aspx_beginners
Subject: [aspx_beginners] RE: PageCount?
I'm actually using a datareader as the records are stored in a query.
-----Original Message-----
From: Simon Hargreaves
[mailto:simon.hargreaves@r...]
Sent: 29 October 2002 12:27
To: aspx_beginners
Subject: [aspx_beginners] RE: PageCount?
Paul,
If i understand what you want correctly, and you are using a dataset.
Its a
bit distant in my memory now but I think something like
MyDataset.MyTableName.RecordCount
Should work.
Simon
-----Original Message-----
From: Paul Riley [mailto:rilez@t...]
Sent: 29 October 2002 12:10
To: aspx_beginners
Subject: [aspx_beginners] PageCount?
I have recently started developing in aspx from asp. I used the use the
pagecount of a recordset to return the total number of records returned.
I cannot see how to do this in aspx without selecting a count and then
selecting the actual records which is of course inefficient. Anyone
point me in the correct direction :O)?
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
Message #5 by "Paul Riley" <rilez@t...> on Tue, 29 Oct 2002 13:38:52 -0000
|
|
An OLEDBDatareader gets its data from a oledbcommand object which
operates on a oledbconnection object. Therefore it is built for doing
this. I know I can get the row count by literally counting through the
rows but this isn't overly efficient and I really need to make sure that
this one page is as lean as possible. From what I can tell the
method/property that I'm after doesn't exist so I'll just continue
selecting the count first.
Thanks for the help anyway
-----Original Message-----
From: Simon Hargreaves
[mailto:simon.hargreaves@r...]
Sent: 29 October 2002 13:38
To: aspx_beginners
Subject: [aspx_beginners] RE: PageCount?
Paul,
A datareader, from my memory, is for reading a text based data file. A
recordcount being more of a recordset (Database) property.
One way of dealing with your problem (And there are probably better ones
!
:o)) is to use the datareader's peek method which looks ahead one line
to
discover if there's anything there and can be made to return true or
false,
combined with a 'MylineCount++' loop would populate a variable with your
linecount. I don't remember ever using something line a
MyDataReader.linecount.
HTH
S
-----Original Message-----
From: Paul Riley [mailto:rilez@t...]
Sent: 29 October 2002 12:47
To: aspx_beginners
Subject: [aspx_beginners] RE: PageCount?
I'm actually using a datareader as the records are stored in a query.
-----Original Message-----
From: Simon Hargreaves
[mailto:simon.hargreaves@r...]
Sent: 29 October 2002 12:27
To: aspx_beginners
Subject: [aspx_beginners] RE: PageCount?
Paul,
If i understand what you want correctly, and you are using a dataset.
Its a
bit distant in my memory now but I think something like
MyDataset.MyTableName.RecordCount
Should work.
Simon
-----Original Message-----
From: Paul Riley [mailto:rilez@t...]
Sent: 29 October 2002 12:10
To: aspx_beginners
Subject: [aspx_beginners] PageCount?
I have recently started developing in aspx from asp. I used the use the
pagecount of a recordset to return the total number of records returned.
I cannot see how to do this in aspx without selecting a count and then
selecting the actual records which is of course inefficient. Anyone
point me in the correct direction :O)?
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
|
|
 |