Choosing an approach ...

G

Guest

I would like som input on what approach to choose for the scenario I have ...

Im making a simple asp-app to list the Top 50 something and also allow
visitors to vote on items and add new suggestions. The top-list should be
divided into parts of 10 items each where the first 10 are extra large and
highlighted, the next 10 less highlighted and so on...

Im using VS 2008 beta 2 with SQL Express as database.

Previously I used to make almost all my sites using only XML and XSLT and it
worked pretty well. But for this project I want to learn ASP better since I
havnt worked much with it since the classic ASP-days and much seem to have
changed since then.
To start with, the Repeater seems to be what I need. I have hooked it up to
my database using a SqlDataSource. I now have one list with all items in the
database. Now I want 5 Repeaters with 1-10 in the first, 11-20 in the second
and so forth. How do i accomplish this? It should be easy and it probably is
bit I cant figgure it out. It doesnt seem to be possible to select a
subset-range of items from the database? The closest I could get was using
SELECT TOP 20 * ... but that isnt good enough obviously. And anyway, shouldnt
it be more effective to first fetch the TOP 50 items and the distribute them
accordingly using code-behind? I mean to reduce the number of calls to the
database. But is this possible?
Secondly, I have looked into the new LINQ feature and it seemed to have some
methods SKIP and TAKE which could come in handy. But when creating a
LinqDatasource the populate my list I dont get any options to use these
methods. I always get the entire Table without any possibility to apply a
range-filter of any sort...
 
B

bruce barker

using ranking functions in sqlserver you should be able to load your 50
into a dataset and identify each group. then create views for each group
with the dataset. then bind the views.

-- bruce (sqlwork.com)
 

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,774
Messages
2,569,598
Members
45,150
Latest member
MakersCBDReviews
Top