Databinding ASP.NET 2.0 Repeater to LLBLGenProDataSource?

Posts   
 
    
mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 03-Aug-2006 23:40:38   

Hello,

When I attempt to bind a LLBLGenProDataSource to a disconnected EntityCollection (Live Prescence = False), I get no data.

However, if I set the Repeater.DataSource = EntityCollection, it works OK.

So how do I use the LLBLGenProDataSource with a Repeater control?

Thanks.

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 03-Aug-2006 23:46:06   

Since you have live persistance=false, did you code the PerformSelect event on the datasource?

mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 03-Aug-2006 23:47:54   

WayneBrantley wrote:

Since you have live persistance=false, did you code the PerformSelect event on the datasource?

Ahh ooops... I knew I forgot something.

Actually needed to add PerformDbCount too.

So, why are these functions needed when LivePresence = false? Shouldn't LLBLGen be able to get the count from the EntityCollection.Count?

Also, is there any advantage to using the LLBLGenProDataSource Control if I'm only doing a read-only repeater? Would it be better to bind an EntityCollection directly to the Repeater itself?

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 04-Aug-2006 01:20:40   

So, why are these functions needed when LivePresence = false? Shouldn't LLBLGen be able to get the count from the EntityCollection.Count?

The count is needed to create the paging control. The collection will only contain enough information to show 1 page of data. So you may have a query that finds 100 records, but if your page only shows 20 then EntityCollection.Count returns 20.

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 04-Aug-2006 03:18:41   

Also, is there any advantage to using the LLBLGenProDataSource Control if I'm only doing a read-only repeater? Would it be better to bind an EntityCollection directly to the Repeater itself?

Advantage is you would not need any code. Disadvantage is if you need to sort/filter/prefetch you have to write those in the page load - so you might just want to bind directly anyway....

So, why are these functions needed when LivePresence = false? Shouldn't LLBLGen be able to get the count from the EntityCollection.Count?

Also, note you do NOT need the count if Paging=false