DataList - Bind 5 records at a time from SQL Server ?

E

Elliot Cohen

I would like to retrieve 5 records (of products) at a
time from an SQL Server database and display them in an
ASP:DataList control (or possibly an ASP:Repeater
control). I only want to display 5 records at a time on
each web page. The user will be able to see more products
by navigating to the next 5 items etc in a similar way to
how users navigate on search engine results. The user
will also be able to select which order the items will be
displayed in according to different criteria (model
number, price etc.).

My main problem is, what is the most efficient way to
obtain records n to n+5 and bind them to a datalist
control? Ideally I would like to write a stored procedure
to extract just those records and then I will attach them
to a DataReader object which I could then bind to the
DataList control. But how can I obtain just those 5
records?

TIA
Elliot Cohen
Messorah Software
 

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

Staff online

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top