Some DataGrid question

  • Thread starter Thread starter Arsalan
  • Start date Start date
A

Arsalan

Suppose I have large database around 10,000 rows,

I have a datagrid which shows 20 rows in a page, so its pointless to call
DataAdapter's fill command [bec its gonna fill the dataset with 10,000 rows,
what SQL statement should i use, if for e.g i want display page 5?]

How do I display the data efficiently ?
 
It looks like the artical goes over alot of stuff. I don't know how good
the performance on this is but it might work for you as a quick and durty
hack.

select *
from ( select top 10 *
from ( select top 30 *
from Customers
order by CustomerID) as temp1
order by CustomerID desc) as temp2
order by CustomerID

That little script would return the set of items from 21-30. Just adjust
the number 30 as nessisary when displaying the page.

Cheers!

David Kyle
 
Good one.
David Kyle said:
It looks like the artical goes over alot of stuff. I don't know how good
the performance on this is but it might work for you as a quick and durty
hack.

select *
from ( select top 10 *
from ( select top 30 *
from Customers
order by CustomerID) as temp1
order by CustomerID desc) as temp2
order by CustomerID

That little script would return the set of items from 21-30. Just adjust
the number 30 as nessisary when displaying the page.

Cheers!

David Kyle

Arsalan said:
Suppose I have large database around 10,000 rows,

I have a datagrid which shows 20 rows in a page, so its pointless to call
DataAdapter's fill command [bec its gonna fill the dataset with 10,000
rows, what SQL statement should i use, if for e.g i want display page 5?]

How do I display the data efficiently ?
 

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

Back
Top