paging search results

R

Ramu

is there any control which I can use to display search results using
paging, I don't want to get all the results from database, instead I
want to make a database call to get the results for each page. can I
use datagridview or listview control to page through the search
results and make database call on page index changed event?
 
G

Guest

I dont know of any way of doing this automatically as there isnt a nice way
to say to all databases, give me results 10 - 20. You can use in SQLServer
"Select Top 20" but then on the next page you would need to select top 30,
plus the other problem is that because you are rerunning the whole query for
this, the resources are used again and the results may be different.
The best way to do this might be to create a datareader and then keep it
open and populate a datatable as people move through the data. This would
stop the data having to be moved to the client until needed but the query
would need to run to return it all.

Why do you need this functionality as there may be a different option.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top