LLBLGenProDataSource2 prevent loading

Posts   
 
    
Jed
User
Posts: 38
Joined: 08-Oct-2010
# Posted on: 19-Apr-2011 15:53:04   

I need to prevent the LLBLGenProDataSource2 from load on the load o my asp.net page. THe reason for this is that it loads 2gb of data into memory. I want to populate the LLBLGenProDataSource2 by a search button this.TicketCollectionDataSource.EntityCollection = (EntityCollection<TicketEntity>)TicketRadGrid.DataSource. The problem is that the LLBLGenProDataSource2 load on the page load

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 19-Apr-2011 21:40:24   

Please can you show us the code you are using at the moment that loads the grid entity collection on the page load ?

The easy way to prevent it would be to simply remove the call from the page load event.

2Gb is a massive amount of data, you need to find some way to filter this before it is loaded.

Matt

Jed
User
Posts: 38
Joined: 08-Oct-2010
# Posted on: 20-Apr-2011 08:16:28   

<llblgenpro:LLBLGenProDataSource2 ID="TicketPriorityCollectionDataSource" runat="server" DataContainerType="EntityCollection" EnablePaging="True" AdapterTypeName="Data.Rad.DatabaseSpecific.CustomDataAccessAdapter, Data.RadDBSpecific" EntityFactoryTypeName="Data.Rad.FactoryClasses.TicketPriorityEntityFactory, Data.Rad"> <SelectParameters> <aspstuck_out_tongue_winking_eye arameter Name="IsActive" DbType="Boolean" DefaultValue="True" /> </SelectParameters> </llblgenpro:LLBLGenProDataSource2>

<llblgenpro:LLBLGenProDataSource2 ID="MessageCollectionDataSource" runat="server"
     DataContainerType="EntityCollection" EnablePaging="True"
    AdapterTypeName="Data.Rad.DatabaseSpecific.CustomDataAccessAdapter, Data.RadDBSpecific"
    EntityFactoryTypeName="Data.Rad.FactoryClasses.MessageEntityFactory, Data.Rad">
    <SelectParameters>
        <asp:P arameter Name="IsActive" DbType="Boolean" DefaultValue="True" />
    </SelectParameters>
</llblgenpro:LLBLGenProDataSource2>

Here is my datasource control in markup. Is there a way to stop these from loading all there data. I need to populate them later.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 20-Apr-2011 08:34:19   

Don't wire the DS to the control at design time (I mean not in the aspx code). But rather in the code when you need that to happen (to load).

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 20-Apr-2011 09:53:47   

The best way is to set LivePersistence to false on the control and handle the fetch in the event handlers as described in the documentation. And initially load the control's data in the Page onload event handler, as Walaa said

Frans Bouma | Lead developer LLBLGen Pro