473,323 Members | 1,551 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,323 software developers and data experts.

Some DataGrid question

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 ?
Nov 19 '05 #1
5 860
On Mon, 07 Mar 2005 14:23:03 -0600, Arsalan <ar***********@hotmail.com>
wrote:
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 ?


A rather good article

http://www.thecodeproject.com/aspnet...id=42080&exp=0

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 19 '05 #2
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" <ar***********@hotmail.com> wrote in message
news:OQ*************@TK2MSFTNGP15.phx.gbl...
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 ?

Nov 19 '05 #3
Try using stored procedures!
That could help!
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #4
Thansk
"Craig Deelsnyder" <cdeelsny@no_spam_4_meyahoo.com> wrote in message
news:op***************@deelscwxp.na.corp.born.com. ..
On Mon, 07 Mar 2005 14:23:03 -0600, Arsalan <ar***********@hotmail.com>
wrote:
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 ?


A rather good article

http://www.thecodeproject.com/aspnet...id=42080&exp=0

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET

Nov 19 '05 #5
Good one.
"David Kyle" <dk***@pacificonline.com> wrote in message
news:uf**************@TK2MSFTNGP10.phx.gbl...
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" <ar***********@hotmail.com> wrote in message
news:OQ*************@TK2MSFTNGP15.phx.gbl...
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 ?


Nov 19 '05 #6

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

Similar topics

2
by: magister | last post by:
Hello, I have xml like this.... <test> <question>sdfsa</question> <section><question>43ga</question> <question>asdf</question> </test>
0
by: Randy | last post by:
Hello, I have two questions... I have a datagrid. I'm capturing the cell via HitTestInfo. The first question is fairly simple. I'm using an example of how to capture the row/column I found on the...
3
by: BBFrost | last post by:
Ok, I know how to count the number of selected datagrid rows using the code below. What has me stumped is how to determine when the selected rows within a datagrid have been changed. The...
6
by: BBFrost | last post by:
I'm using Net 1.1 (2003) SP1 & Windows 2000 Here's the issue ... Rows 12 thru 24 are selected in a datagrid. The user now unselects rows 12 thru 24 and selects rows 45 thru 70 ??? How can...
2
by: Sky | last post by:
Hello: Another question about trying to wring functionality from a DataGrid... Have a DB table of "Contacts" -- 14 or more fields per record Show in datagrid -- but only 5 columns (First,Last,...
3
by: Danky | last post by:
Hello Masters! Anyone can help me with the datagrid, well, the app load a lot of data from DB and it show on the datagrid, and well, I need to allow paging and.... the issue is with the event...
3
by: Skowronek | last post by:
What is the best method to obtain a data value from a parent datagriditem from a child datagrid - datagrid footer item command event handler? Here is the layout of my asp.net controls ...
2
by: Brad Shook | last post by:
First of all thinks to Cor Ligthert for helping me with this last week. If you wild like to read Cor's comments please refer to the posting from 10/14/2004 and 8:48AM "Help with Advanced...
13
by: pmcguire | last post by:
I have a DataGrid control for which I have also created several new extended DataGridColumnStyles. They behave pretty nicely, but I can't figure out how to implement Selected Item formatting for...
10
by: amiga500 | last post by:
Hello, I have one basic simple question. When I have multiple records in the datagrid as follows: Code Product 1 Product 2 Product 3 11111 A B C...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.