ConnectionString property has not been initialized

Posts   
 
    
renejdm
User
Posts: 15
Joined: 24-Jul-2007
# Posted on: 17-May-2011 18:45:23   

Hi,

I am trying the trial version of LLBLGen Pro 3.1. I am using SQL Server Compact 3.5 in a Winforms project created with Visual Studio 2008.

I am trying to run the following code:

PetsWithPicFilenameTypedList petsList = new PetsWithPicFilenameTypedList();

        using (DataAccessAdapter adapter = new DataAccessAdapter())
        {
            IRelationPredicateBucket bucket = petsList.GetRelationInfo();
            bucket.PredicateExpression.Add(PetFields.PetVisible == 1);
            ISortExpression sorter = new SortExpression(PetFields.PetCallName | SortOperator.Ascending);
            adapter.FetchTypedList(petsList.GetFieldsInfo(), petsList, bucket, 0, sorter, false);
        }

and I am getting an "InvalidOperationException was unhandled: ConnectionString property has not been initialized" error message.

I have created a SQL Server Express database and then created an LLBLGen project and generated the code. Now I want to run the code against the equivalent compact database.

I think there is something wrong with my connection string.

Can someone help.

Rene

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 17-May-2011 20:21:30   

add the connection string generated in the generated app.config file to the app.config file of your own application, as that's the one being used by your application.

Frans Bouma | Lead developer LLBLGen Pro
renejdm
User
Posts: 15
Joined: 24-Jul-2007
# Posted on: 17-May-2011 20:21:30   

Okay I found the problem. I was using the wrong connection string name. This thread helped me solve the problem: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=17273&HighLight=1

Thanks,

Rene