473,513 Members | 2,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Iterating through specific rows of DataReader...

Hi guys,
Say I made a SELECT statement to my sql DB that would return 50 rows
that I will use a sqldatareader to access. Instead of iterating through
each and every row of the datareader, I'd like to just iterate through,
say, rows 20 through 30.

How can one do this?

Thanks very much

Jacko

Nov 17 '05 #1
14 4304
Not possible, DataSet would be a candidate to start somewhere in the middle.

"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Hi guys,
Say I made a SELECT statement to my sql DB that would return 50 rows
that I will use a sqldatareader to access. Instead of iterating through
each and every row of the datareader, I'd like to just iterate through,
say, rows 20 through 30.

How can one do this?

Thanks very much

Jacko

Nov 17 '05 #2
Not possible, DataSet would be a candidate to start somewhere in the middle.

"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Hi guys,
Say I made a SELECT statement to my sql DB that would return 50 rows
that I will use a sqldatareader to access. Instead of iterating through
each and every row of the datareader, I'd like to just iterate through,
say, rows 20 through 30.

How can one do this?

Thanks very much

Jacko

Nov 17 '05 #3
If you only need rows 20-30, why return all 50? Possibly to use them afterwards - at some point. But you want to close the DataReader as soon as possible and don't keep the connection open.

The DataSet offers the disconnected architecture that you want.

Regards,
Wim Hollebrandse
http://www.wimdows.net
http://www.wimdows.com

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 17 '05 #4
If you only need rows 20-30, why return all 50? Possibly to use them afterwards - at some point. But you want to close the DataReader as soon as possible and don't keep the connection open.

The DataSet offers the disconnected architecture that you want.

Regards,
Wim Hollebrandse
http://www.wimdows.net
http://www.wimdows.com

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 17 '05 #5
Rajesh,

Just as I suspected. Thank you. One more question, though, if you will.
What if my SELECT statement gives 5,000 rows, or even 50,000. I want to
display this data only 50 rows per page. Would one populate a DataSet
with the entire 50,000 rows? Then programmatically display 50 at a time?
Or would one use a DataReader, and if one was viewing page 10, for
example, the program would skip the first 500 rows and then display 500
through 550?

Sorry if I'm a little too verbose about this. I just want the best way
to display a large amount of rows only a few rows per page.

Thanks very much for any help you can give. And thanks for your help to
everyone here, i see you have posted quite a few responses.

Jack

Rajesh.V wrote:
Not possible, DataSet would be a candidate to start somewhere in the middle.

"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Hi guys,
Say I made a SELECT statement to my sql DB that would return 50 rows
that I will use a sqldatareader to access. Instead of iterating through
each and every row of the datareader, I'd like to just iterate through,
say, rows 20 through 30.

How can one do this?

Thanks very much

Jacko



Nov 17 '05 #6
Rajesh,

Just as I suspected. Thank you. One more question, though, if you will.
What if my SELECT statement gives 5,000 rows, or even 50,000. I want to
display this data only 50 rows per page. Would one populate a DataSet
with the entire 50,000 rows? Then programmatically display 50 at a time?
Or would one use a DataReader, and if one was viewing page 10, for
example, the program would skip the first 500 rows and then display 500
through 550?

Sorry if I'm a little too verbose about this. I just want the best way
to display a large amount of rows only a few rows per page.

Thanks very much for any help you can give. And thanks for your help to
everyone here, i see you have posted quite a few responses.

Jack

Rajesh.V wrote:
Not possible, DataSet would be a candidate to start somewhere in the middle.

"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Hi guys,
Say I made a SELECT statement to my sql DB that would return 50 rows
that I will use a sqldatareader to access. Instead of iterating through
each and every row of the datareader, I'd like to just iterate through,
say, rows 20 through 30.

How can one do this?

Thanks very much

Jacko



Nov 17 '05 #7
Nice question, which occurs to most dealing with huge data reporting
requiremnets.

Now for this, you will have to fool the user to thinking he can access any
record out of the data store. That is by using...
1. A search page which narrows down the result to manageable qty.
2. Now if he still wants to wade thru 50k or higher record we have to do
some tricky programming. will take time but worth the effort. So here goes.

a. first show him 20 records, (as much as can fit in a screen).
b. then when he requests to see next page fetch the next 20 records.
c. This way u have to keep the begin and end record numbers in a hidden
field.
d. Use custom paging which exposes the events next page and previous page of
the DataGrid.

At the db level say a storedproc accepts two params begin and start. Here is
where your Sql magic has to be worked in
extracting only the recordset for a given sql (say 25000 - 25100).

Also if you have a large no. of reports, duplicating the above is going to
be trying. Try dbnetgrid.com, their dbgrid is really good, i still don know
whether the component pulls all the records or a slice of them. The grid
handles this beautifully without any postback. Pagination comes with the
component as well as conversion to excel/xml/pdf.....
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Rajesh,

Just as I suspected. Thank you. One more question, though, if you will.
What if my SELECT statement gives 5,000 rows, or even 50,000. I want to
display this data only 50 rows per page. Would one populate a DataSet
with the entire 50,000 rows? Then programmatically display 50 at a time?
Or would one use a DataReader, and if one was viewing page 10, for
example, the program would skip the first 500 rows and then display 500
through 550?

Sorry if I'm a little too verbose about this. I just want the best way
to display a large amount of rows only a few rows per page.

Thanks very much for any help you can give. And thanks for your help to
everyone here, i see you have posted quite a few responses.

Jack

Rajesh.V wrote:
Not possible, DataSet would be a candidate to start somewhere in the middle.
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Hi guys,
Say I made a SELECT statement to my sql DB that would return 50 rows
that I will use a sqldatareader to access. Instead of iterating through
each and every row of the datareader, I'd like to just iterate through,
say, rows 20 through 30.

How can one do this?

Thanks very much

Jacko


Nov 17 '05 #8
Nice question, which occurs to most dealing with huge data reporting
requiremnets.

Now for this, you will have to fool the user to thinking he can access any
record out of the data store. That is by using...
1. A search page which narrows down the result to manageable qty.
2. Now if he still wants to wade thru 50k or higher record we have to do
some tricky programming. will take time but worth the effort. So here goes.

a. first show him 20 records, (as much as can fit in a screen).
b. then when he requests to see next page fetch the next 20 records.
c. This way u have to keep the begin and end record numbers in a hidden
field.
d. Use custom paging which exposes the events next page and previous page of
the DataGrid.

At the db level say a storedproc accepts two params begin and start. Here is
where your Sql magic has to be worked in
extracting only the recordset for a given sql (say 25000 - 25100).

Also if you have a large no. of reports, duplicating the above is going to
be trying. Try dbnetgrid.com, their dbgrid is really good, i still don know
whether the component pulls all the records or a slice of them. The grid
handles this beautifully without any postback. Pagination comes with the
component as well as conversion to excel/xml/pdf.....
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Rajesh,

Just as I suspected. Thank you. One more question, though, if you will.
What if my SELECT statement gives 5,000 rows, or even 50,000. I want to
display this data only 50 rows per page. Would one populate a DataSet
with the entire 50,000 rows? Then programmatically display 50 at a time?
Or would one use a DataReader, and if one was viewing page 10, for
example, the program would skip the first 500 rows and then display 500
through 550?

Sorry if I'm a little too verbose about this. I just want the best way
to display a large amount of rows only a few rows per page.

Thanks very much for any help you can give. And thanks for your help to
everyone here, i see you have posted quite a few responses.

Jack

Rajesh.V wrote:
Not possible, DataSet would be a candidate to start somewhere in the middle.
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Hi guys,
Say I made a SELECT statement to my sql DB that would return 50 rows
that I will use a sqldatareader to access. Instead of iterating through
each and every row of the datareader, I'd like to just iterate through,
say, rows 20 through 30.

How can one do this?

Thanks very much

Jacko


Nov 17 '05 #9
fdg
Rajesh,

We think alike. This is the way I had it before. But since i sometimes
have to delete rows, consecutive record numbers arent always 1,2,3,4,5
but can be 1,3,4,6, since i deleted 2 and 5 (for example). So a sql
query based purely on record number won't give me completely accurate
results if some of the rows are missing, thus the pattern of
consecutively growing record numbers is broken.

Would it be much of a performance hit if I do a datareader and just
DataReader.Read() through them until I get to the desired range? Even if
I go through, say, 500, or 1,000?

You're a big asset to this newsgroup!!

Rajesh.V wrote:
Nice question, which occurs to most dealing with huge data reporting
requiremnets.

Now for this, you will have to fool the user to thinking he can access any
record out of the data store. That is by using...
1. A search page which narrows down the result to manageable qty.
2. Now if he still wants to wade thru 50k or higher record we have to do
some tricky programming. will take time but worth the effort. So here goes.

a. first show him 20 records, (as much as can fit in a screen).
b. then when he requests to see next page fetch the next 20 records.
c. This way u have to keep the begin and end record numbers in a hidden
field.
d. Use custom paging which exposes the events next page and previous page of
the DataGrid.

At the db level say a storedproc accepts two params begin and start. Here is
where your Sql magic has to be worked in
extracting only the recordset for a given sql (say 25000 - 25100).

Also if you have a large no. of reports, duplicating the above is going to
be trying. Try dbnetgrid.com, their dbgrid is really good, i still don know
whether the component pulls all the records or a slice of them. The grid
handles this beautifully without any postback. Pagination comes with the
component as well as conversion to excel/xml/pdf.....
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Rajesh,

Just as I suspected. Thank you. One more question, though, if you will.
What if my SELECT statement gives 5,000 rows, or even 50,000. I want to
display this data only 50 rows per page. Would one populate a DataSet
with the entire 50,000 rows? Then programmatically display 50 at a time?
Or would one use a DataReader, and if one was viewing page 10, for
example, the program would skip the first 500 rows and then display 500
through 550?

Sorry if I'm a little too verbose about this. I just want the best way
to display a large amount of rows only a few rows per page.

Thanks very much for any help you can give. And thanks for your help to
everyone here, i see you have posted quite a few responses.

Jack

Rajesh.V wrote:

Not possible, DataSet would be a candidate to start somewhere in the
middle.
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Hi guys,
Say I made a SELECT statement to my sql DB that would return 50 rows
that I will use a sqldatareader to access. Instead of iterating through
each and every row of the datareader, I'd like to just iterate through,
say, rows 20 through 30.

How can one do this?

Thanks very much

Jacko



Nov 17 '05 #10
fdg
Rajesh,

We think alike. This is the way I had it before. But since i sometimes
have to delete rows, consecutive record numbers arent always 1,2,3,4,5
but can be 1,3,4,6, since i deleted 2 and 5 (for example). So a sql
query based purely on record number won't give me completely accurate
results if some of the rows are missing, thus the pattern of
consecutively growing record numbers is broken.

Would it be much of a performance hit if I do a datareader and just
DataReader.Read() through them until I get to the desired range? Even if
I go through, say, 500, or 1,000?

You're a big asset to this newsgroup!!

Rajesh.V wrote:
Nice question, which occurs to most dealing with huge data reporting
requiremnets.

Now for this, you will have to fool the user to thinking he can access any
record out of the data store. That is by using...
1. A search page which narrows down the result to manageable qty.
2. Now if he still wants to wade thru 50k or higher record we have to do
some tricky programming. will take time but worth the effort. So here goes.

a. first show him 20 records, (as much as can fit in a screen).
b. then when he requests to see next page fetch the next 20 records.
c. This way u have to keep the begin and end record numbers in a hidden
field.
d. Use custom paging which exposes the events next page and previous page of
the DataGrid.

At the db level say a storedproc accepts two params begin and start. Here is
where your Sql magic has to be worked in
extracting only the recordset for a given sql (say 25000 - 25100).

Also if you have a large no. of reports, duplicating the above is going to
be trying. Try dbnetgrid.com, their dbgrid is really good, i still don know
whether the component pulls all the records or a slice of them. The grid
handles this beautifully without any postback. Pagination comes with the
component as well as conversion to excel/xml/pdf.....
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Rajesh,

Just as I suspected. Thank you. One more question, though, if you will.
What if my SELECT statement gives 5,000 rows, or even 50,000. I want to
display this data only 50 rows per page. Would one populate a DataSet
with the entire 50,000 rows? Then programmatically display 50 at a time?
Or would one use a DataReader, and if one was viewing page 10, for
example, the program would skip the first 500 rows and then display 500
through 550?

Sorry if I'm a little too verbose about this. I just want the best way
to display a large amount of rows only a few rows per page.

Thanks very much for any help you can give. And thanks for your help to
everyone here, i see you have posted quite a few responses.

Jack

Rajesh.V wrote:

Not possible, DataSet would be a candidate to start somewhere in the
middle.
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Hi guys,
Say I made a SELECT statement to my sql DB that would return 50 rows
that I will use a sqldatareader to access. Instead of iterating through
each and every row of the datareader, I'd like to just iterate through,
say, rows 20 through 30.

How can one do this?

Thanks very much

Jacko



Nov 17 '05 #11
Here is an article demonstrating paging using a Stored Procedure and temp
tables in SQL Server. It's for ASP, but you should be able to use it.
http://www.aspfaq.com/show.asp?id=2120

Bob Lehmann

"fdg" <dg***@ddg.com> wrote in message news:3F**************@ddg.com...
Rajesh,

We think alike. This is the way I had it before. But since i sometimes
have to delete rows, consecutive record numbers arent always 1,2,3,4,5
but can be 1,3,4,6, since i deleted 2 and 5 (for example). So a sql
query based purely on record number won't give me completely accurate
results if some of the rows are missing, thus the pattern of
consecutively growing record numbers is broken.

Would it be much of a performance hit if I do a datareader and just
DataReader.Read() through them until I get to the desired range? Even if
I go through, say, 500, or 1,000?

You're a big asset to this newsgroup!!

Rajesh.V wrote:
Nice question, which occurs to most dealing with huge data reporting
requiremnets.

Now for this, you will have to fool the user to thinking he can access any record out of the data store. That is by using...
1. A search page which narrows down the result to manageable qty.
2. Now if he still wants to wade thru 50k or higher record we have to do
some tricky programming. will take time but worth the effort. So here goes.
a. first show him 20 records, (as much as can fit in a screen).
b. then when he requests to see next page fetch the next 20 records.
c. This way u have to keep the begin and end record numbers in a hidden
field.
d. Use custom paging which exposes the events next page and previous page of the DataGrid.

At the db level say a storedproc accepts two params begin and start. Here is where your Sql magic has to be worked in
extracting only the recordset for a given sql (say 25000 - 25100).

Also if you have a large no. of reports, duplicating the above is going to be trying. Try dbnetgrid.com, their dbgrid is really good, i still don know whether the component pulls all the records or a slice of them. The grid
handles this beautifully without any postback. Pagination comes with the
component as well as conversion to excel/xml/pdf.....
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Rajesh,

Just as I suspected. Thank you. One more question, though, if you will.
What if my SELECT statement gives 5,000 rows, or even 50,000. I want to
display this data only 50 rows per page. Would one populate a DataSet
with the entire 50,000 rows? Then programmatically display 50 at a time?
Or would one use a DataReader, and if one was viewing page 10, for
example, the program would skip the first 500 rows and then display 500
through 550?

Sorry if I'm a little too verbose about this. I just want the best way
to display a large amount of rows only a few rows per page.

Thanks very much for any help you can give. And thanks for your help to
everyone here, i see you have posted quite a few responses.

Jack

Rajesh.V wrote:
Not possible, DataSet would be a candidate to start somewhere in the

middle.
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
>Hi guys,
>
>
>Say I made a SELECT statement to my sql DB that would return 50 rows
>that I will use a sqldatareader to access. Instead of iterating through>each and every row of the datareader, I'd like to just iterate through,>say, rows 20 through 30.
>
>How can one do this?
>
>Thanks very much
>
>Jacko
>
>
>


Nov 17 '05 #12
Here is an article demonstrating paging using a Stored Procedure and temp
tables in SQL Server. It's for ASP, but you should be able to use it.
http://www.aspfaq.com/show.asp?id=2120

Bob Lehmann

"fdg" <dg***@ddg.com> wrote in message news:3F**************@ddg.com...
Rajesh,

We think alike. This is the way I had it before. But since i sometimes
have to delete rows, consecutive record numbers arent always 1,2,3,4,5
but can be 1,3,4,6, since i deleted 2 and 5 (for example). So a sql
query based purely on record number won't give me completely accurate
results if some of the rows are missing, thus the pattern of
consecutively growing record numbers is broken.

Would it be much of a performance hit if I do a datareader and just
DataReader.Read() through them until I get to the desired range? Even if
I go through, say, 500, or 1,000?

You're a big asset to this newsgroup!!

Rajesh.V wrote:
Nice question, which occurs to most dealing with huge data reporting
requiremnets.

Now for this, you will have to fool the user to thinking he can access any record out of the data store. That is by using...
1. A search page which narrows down the result to manageable qty.
2. Now if he still wants to wade thru 50k or higher record we have to do
some tricky programming. will take time but worth the effort. So here goes.
a. first show him 20 records, (as much as can fit in a screen).
b. then when he requests to see next page fetch the next 20 records.
c. This way u have to keep the begin and end record numbers in a hidden
field.
d. Use custom paging which exposes the events next page and previous page of the DataGrid.

At the db level say a storedproc accepts two params begin and start. Here is where your Sql magic has to be worked in
extracting only the recordset for a given sql (say 25000 - 25100).

Also if you have a large no. of reports, duplicating the above is going to be trying. Try dbnetgrid.com, their dbgrid is really good, i still don know whether the component pulls all the records or a slice of them. The grid
handles this beautifully without any postback. Pagination comes with the
component as well as conversion to excel/xml/pdf.....
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Rajesh,

Just as I suspected. Thank you. One more question, though, if you will.
What if my SELECT statement gives 5,000 rows, or even 50,000. I want to
display this data only 50 rows per page. Would one populate a DataSet
with the entire 50,000 rows? Then programmatically display 50 at a time?
Or would one use a DataReader, and if one was viewing page 10, for
example, the program would skip the first 500 rows and then display 500
through 550?

Sorry if I'm a little too verbose about this. I just want the best way
to display a large amount of rows only a few rows per page.

Thanks very much for any help you can give. And thanks for your help to
everyone here, i see you have posted quite a few responses.

Jack

Rajesh.V wrote:
Not possible, DataSet would be a candidate to start somewhere in the

middle.
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
>Hi guys,
>
>
>Say I made a SELECT statement to my sql DB that would return 50 rows
>that I will use a sqldatareader to access. Instead of iterating through>each and every row of the datareader, I'd like to just iterate through,>say, rows 20 through 30.
>
>How can one do this?
>
>Thanks very much
>
>Jacko
>
>
>


Nov 17 '05 #13
Hi fdg(din get ur name)

Tx and nice to be of some help. As u said of consecutive record nos. Anyway
to delete or update we have to fallback on the primarykey to uniquely id the
rec and not based on which position u are.

Talking of perf hit, if the records are small say less than 1k, its ok. But
jus thinkin of the fact u are pulling records from the db just to get at the
reqd ones and discarding is not good.

"fdg" <dg***@ddg.com> wrote in message news:3F**************@ddg.com...
Rajesh,

We think alike. This is the way I had it before. But since i sometimes
have to delete rows, consecutive record numbers arent always 1,2,3,4,5
but can be 1,3,4,6, since i deleted 2 and 5 (for example). So a sql
query based purely on record number won't give me completely accurate
results if some of the rows are missing, thus the pattern of
consecutively growing record numbers is broken.

Would it be much of a performance hit if I do a datareader and just
DataReader.Read() through them until I get to the desired range? Even if
I go through, say, 500, or 1,000?

You're a big asset to this newsgroup!!

Rajesh.V wrote:
Nice question, which occurs to most dealing with huge data reporting
requiremnets.

Now for this, you will have to fool the user to thinking he can access any record out of the data store. That is by using...
1. A search page which narrows down the result to manageable qty.
2. Now if he still wants to wade thru 50k or higher record we have to do
some tricky programming. will take time but worth the effort. So here goes.
a. first show him 20 records, (as much as can fit in a screen).
b. then when he requests to see next page fetch the next 20 records.
c. This way u have to keep the begin and end record numbers in a hidden
field.
d. Use custom paging which exposes the events next page and previous page of the DataGrid.

At the db level say a storedproc accepts two params begin and start. Here is where your Sql magic has to be worked in
extracting only the recordset for a given sql (say 25000 - 25100).

Also if you have a large no. of reports, duplicating the above is going to be trying. Try dbnetgrid.com, their dbgrid is really good, i still don know whether the component pulls all the records or a slice of them. The grid
handles this beautifully without any postback. Pagination comes with the
component as well as conversion to excel/xml/pdf.....
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Rajesh,

Just as I suspected. Thank you. One more question, though, if you will.
What if my SELECT statement gives 5,000 rows, or even 50,000. I want to
display this data only 50 rows per page. Would one populate a DataSet
with the entire 50,000 rows? Then programmatically display 50 at a time?
Or would one use a DataReader, and if one was viewing page 10, for
example, the program would skip the first 500 rows and then display 500
through 550?

Sorry if I'm a little too verbose about this. I just want the best way
to display a large amount of rows only a few rows per page.

Thanks very much for any help you can give. And thanks for your help to
everyone here, i see you have posted quite a few responses.

Jack

Rajesh.V wrote:
Not possible, DataSet would be a candidate to start somewhere in the

middle.
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
>Hi guys,
>
>
>Say I made a SELECT statement to my sql DB that would return 50 rows
>that I will use a sqldatareader to access. Instead of iterating through>each and every row of the datareader, I'd like to just iterate through,>say, rows 20 through 30.
>
>How can one do this?
>
>Thanks very much
>
>Jacko
>
>
>


Nov 17 '05 #14
fdg
Thanks to all who helped me with my problem. After going to a couple
sites one of you suggested, ive decided to simply use the record number
of the 10th row of everypage as a hidden field, and will use that record
number as the marker for any future requests. Thanks again!

fdg wrote:
Rajesh,

We think alike. This is the way I had it before. But since i sometimes
have to delete rows, consecutive record numbers arent always 1,2,3,4,5
but can be 1,3,4,6, since i deleted 2 and 5 (for example). So a sql
query based purely on record number won't give me completely accurate
results if some of the rows are missing, thus the pattern of
consecutively growing record numbers is broken.

Would it be much of a performance hit if I do a datareader and just
DataReader.Read() through them until I get to the desired range? Even if
I go through, say, 500, or 1,000?

You're a big asset to this newsgroup!!

Rajesh.V wrote:
Nice question, which occurs to most dealing with huge data reporting
requiremnets.

Now for this, you will have to fool the user to thinking he can access
any
record out of the data store. That is by using...
1. A search page which narrows down the result to manageable qty.
2. Now if he still wants to wade thru 50k or higher record we have to do
some tricky programming. will take time but worth the effort. So here
goes.

a. first show him 20 records, (as much as can fit in a screen).
b. then when he requests to see next page fetch the next 20 records.
c. This way u have to keep the begin and end record numbers in a hidden
field.
d. Use custom paging which exposes the events next page and previous
page of
the DataGrid.

At the db level say a storedproc accepts two params begin and start.
Here is
where your Sql magic has to be worked in
extracting only the recordset for a given sql (say 25000 - 25100).

Also if you have a large no. of reports, duplicating the above is
going to
be trying. Try dbnetgrid.com, their dbgrid is really good, i still don
know
whether the component pulls all the records or a slice of them. The grid
handles this beautifully without any postback. Pagination comes with the
component as well as conversion to excel/xml/pdf.....
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
Rajesh,

Just as I suspected. Thank you. One more question, though, if you will.
What if my SELECT statement gives 5,000 rows, or even 50,000. I want to
display this data only 50 rows per page. Would one populate a DataSet
with the entire 50,000 rows? Then programmatically display 50 at a time?
Or would one use a DataReader, and if one was viewing page 10, for
example, the program would skip the first 500 rows and then display 500
through 550?

Sorry if I'm a little too verbose about this. I just want the best way
to display a large amount of rows only a few rows per page.

Thanks very much for any help you can give. And thanks for your help to
everyone here, i see you have posted quite a few responses.

Jack

Rajesh.V wrote:
Not possible, DataSet would be a candidate to start somewhere in the

middle.
"Jacko" <ja******@greykoko.com> wrote in message
news:3F**************@greykoko.com...
> Hi guys,
>
>
> Say I made a SELECT statement to my sql DB that would return 50 rows
> that I will use a sqldatareader to access. Instead of iterating
> through
> each and every row of the datareader, I'd like to just iterate
> through,
> say, rows 20 through 30.
>
> How can one do this?
>
> Thanks very much
>
> Jacko
>
>
>



Nov 17 '05 #15

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

Similar topics

1
1161
by: Claudia Fong | last post by:
Hi, I'm using a DataReader to connect to a db and retrieve data from the db. I just wondering how can I know the numbers of rows contain in my DB for the sql statement I used? For example, if...
0
338
by: Jacko | last post by:
Hi guys, Say I made a SELECT statement to my sql DB that would return 50 rows that I will use a sqldatareader to access. Instead of iterating through each and every row of the datareader, I'd...
2
1566
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...
1
2193
by: ae | last post by:
My datareader looks like this where dtrItemList is the datareader and chklExceptionList is my checkboxlist. the rows come in just fine, but I need help also including the name of the columns for...
3
2612
by: hazz | last post by:
The datareader below contains two rows of two columns but in the for loop, the values for only the first row are getting printed twice. How do I get to the values of the second row? Thanks. -hazz...
6
8463
by: dew | last post by:
How do I get the number of rows a datareader has? I can tell HasRows, but not how many. Thanks.
2
2510
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i want to loop thru my datareader to get all the fieldnames, what's the best way to do this? thanks, rodchar
0
7264
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,...
0
7166
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
7386
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
7543
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
7106
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
5689
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
4749
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
3236
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
1601
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.