Programmatically creating a LLBLGenProDataSource2

Posts   
 
    
worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 30-Nov-2007 07:11:25   

Hey folks,

I'm wanting to programmatically create a prodatasource and use it.

dataSource.ID = "ListDataSource"; dataSource.LivePersistence = false; dataSource.PerformSelect += new EventHandler<PerformSelectEventArgs2>(dataSource_PerformSelect); dataSource.DataContainerType = DataSourceDataContainerType.EntityCollection; Controls.Add(dataSource);

        QueryResults.DataSourceID = "ListDataSource";

This code is executing in the OnInit method of the parent control.

The problem I'm having is the dataSource doesn't appear to be being utilised. The PerformSelect event handler is never called... is it not possible to use DataSourceID at runtime?

I've tried a few combinations including setting the DataSource of the grid to the LLBLgenprocedatasource and calling DataBind... does nothing (but no errors).

Help appreciated simple_smile

worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 30-Nov-2007 08:22:19   

Never mind. The datasource seems to fail silently if you dont' specify and adapter name and entity factory name... problem solved.