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