Some DataGrid question

Discussion in 'ASP .Net' started by Arsalan, Mar 7, 2005.

  1. Arsalan

    Arsalan Guest

    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 ?
    Arsalan, Mar 7, 2005
    #1
    1. Advertising

  2. On Mon, 07 Mar 2005 14:23:03 -0600, Arsalan <>
    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/PagingLarge.asp?select=820618&df=100&forumid=42080&exp=0

    --
    Craig Deelsnyder
    Microsoft MVP - ASP/ASP.NET
    Craig Deelsnyder, Mar 7, 2005
    #2
    1. Advertising

  3. Arsalan

    David Kyle Guest

    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" <> wrote in message
    news:...
    > 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 ?
    >
    David Kyle, Mar 7, 2005
    #3
  4. 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!
    Patrick Olurotimi Ige, Mar 8, 2005
    #4
  5. Arsalan

    Arsalan Guest

    Thansk
    "Craig Deelsnyder" <cdeelsny@no_spam_4_meyahoo.com> wrote in message
    news:eek:...
    > On Mon, 07 Mar 2005 14:23:03 -0600, Arsalan <>
    > 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/PagingLarge.asp?select=820618&df=100&forumid=42080&exp=0
    >
    > --
    > Craig Deelsnyder
    > Microsoft MVP - ASP/ASP.NET
    Arsalan, Mar 8, 2005
    #5
  6. Arsalan

    Arsalan Guest

    Good one.
    "David Kyle" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    >> 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 ?
    >>

    >
    >
    Arsalan, Mar 8, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    0
    Views:
    667
    Guest
    Feb 25, 2004
  2. Eric
    Replies:
    2
    Views:
    1,391
    Tommy
    Feb 13, 2004
  3. ad
    Replies:
    2
    Views:
    708
  4. Piers Chivers
    Replies:
    2
    Views:
    382
    Piers Chivers
    Mar 2, 2004
  5. dolphin
    Replies:
    3
    Views:
    359
    rossum
    Mar 9, 2007
Loading...

Share This Page