Datalist: limit the iterations

Discussion in 'ASP .Net Web Controls' started by SparvHok, Nov 23, 2004.

  1. SparvHok

    SparvHok Guest

    Hi there.

    Just wondering if there is some way to make the Datalist webcontrol,
    only iterate a prespecified number of times?

    Like setting a property (MaxRows perhaps!?).


    --

    +======================================================================+
    | SparrowHawk The Magician |
    | |
    | |
    | |
    | |
    +======================================================================+
    | e-mail: sparvhok[NOSPAM]hotmail.com |
    +======================================================================+
    To send me an email, replace the [NOSPAM] tag with @ sign.
    SparvHok, Nov 23, 2004
    #1
    1. Advertising

  2. The easiest way is to just limit the data coming back from the database.
    You could use the TOP keyword to limit the results returned. For
    example, to return 10 records use:

    SELECT TOP 10 *
    FROM TableName

    hth

    --

    Scott Mitchell

    http://www.4GuysFromRolla.com

    * When you think ASP.NET, think 4GuysFromRolla.com!
    Scott Mitchell [MVP], Nov 23, 2004
    #2
    1. Advertising

  3. SparvHok

    SparvHok Guest

    Scott Mitchell [MVP] wrote:
    > The easiest way is to just limit the data coming back from the database.
    > You could use the TOP keyword to limit the results returned. For
    > example, to return 10 records use:
    >
    > SELECT TOP 10 *
    > FROM TableName
    >
    > hth
    >

    Yes, I know. And that is probably the most sane thing to do, since you
    dont want to extract more than neccesary from the DB. One shouldnt hog
    the database connection more than nec...

    ok, thanx for the answer.

    --

    +======================================================================+
    | SparrowHawk The Magician |
    | |
    | |
    | |
    | |
    +======================================================================+
    | e-mail: sparvhok[NOSPAM]hotmail.com |
    +======================================================================+
    To send me an email, replace the [NOSPAM] tag with @ sign.
    SparvHok, Nov 23, 2004
    #3
    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. Nevyn Twyll
    Replies:
    8
    Views:
    1,847
  2. Gordon Macleod

    Struts iterations

    Gordon Macleod, Jul 21, 2003, in forum: Java
    Replies:
    0
    Views:
    399
    Gordon Macleod
    Jul 21, 2003
  3. Infiniti

    Do something every x iterations

    Infiniti, Jul 7, 2003, in forum: XML
    Replies:
    6
    Views:
    973
    Marrow
    Jul 8, 2003
  4. Replies:
    1
    Views:
    1,069
    Victor Bazarov
    Jun 28, 2005
  5. Luis Cupido
    Replies:
    6
    Views:
    116
    Daniel Kho
    Mar 5, 2014
Loading...

Share This Page