473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 4301
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
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
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
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.