Datalist: limit the iterations

S

SparvHok

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.
 
S

Scott Mitchell [MVP]

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
(e-mail address removed)
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
 
S

SparvHok

Scott said:
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.
 

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

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top