The ConnectionString property has not been initialized.

Posts   
 
    
Brad
User
Posts: 3
Joined: 08-Oct-2008
# Posted on: 08-Oct-2008 21:22:46   

I'm getting the error "The ConnectionString property has not been initialized. " when I try to databind a LLBLGenProDataSource2 control to a Telerik RadGrid. Has anyone run into this error or know how I might resolve it. I'm not sure why it's having a connection string issue as I don't have the issue if LivePersistence="false" and I set the datasource via the code behind. I only get it when I try to LivePersistence, which I would really like to use so that I don't have to do all of the manual coding using the events method.

    
<llblgenpro:LLBLGenProDataSource2 ID="CodeSetsDataSource" runat="server" 
        AdapterTypeName="Wachter.Enterprise.CodeSets.Domain.DatabaseSpecific.DataAccessAdapter, Wachter.Enterprise.CodeSets.Domain" 
        DataContainerType="EntityCollection" 
        LivePersistence="true"
        CacheLocation="Session"
        EntityFactoryTypeName="Wachter.Enterprise.CodeSets.Domain.FactoryClasses.CodeSetEntityFactory, Wachter.Enterprise.CodeSets.Domain">
    </llblgenpro:LLBLGenProDataSource2>
    
        <asp:UpdatePanel ID="uplCodeSets" runat="server">
        <ContentTemplate>

                <telerik:RadGrid ID="rgdCodeSets" 
                    DataSourceID="CodeSetsDataSource"
                    Skin="Default2006" 
                    GridLines="Both" 
                    AutoGenerateEditColumn="true"
                    runat="server">
                    <MasterTableView EditMode="InPlace">
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn Visible="True">
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <EditFormSettings>
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                    <FilterMenu EnableTheming="True" Skin="Default2006">
                        <CollapseAnimation Duration="200" Type="OutQuint" />
                    </FilterMenu>
                </telerik:RadGrid>
            
        </ContentTemplate>
        </asp:UpdatePanel>


Thanks, Brad

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 09-Oct-2008 06:26:23   

Maybe you're setting the connectionString via code-behind too late. If the grid tries to populate the grid (so the llblgenDatasource fetch the data) before you set the connectionString, that should be the reason. Where (load, init, ect) are you setting this value?

David Elizondo | LLBLGen Support Team
Brad
User
Posts: 3
Joined: 08-Oct-2008
# Posted on: 09-Oct-2008 15:48:44   

I determined that the LLBLGen domain layer was generated from a different DB than what I was trying to connect to and I had to point to a different provider with the correct connection string configurations for this to work as expected.

Thanks for your quick response...