Adapter not loading connection string

Posts   
 
    
Posts: 17
Joined: 13-Sep-2006
# Posted on: 13-Sep-2006 12:14:31   

In the generated method ReadConnectionStringFromConfig() for a DataAccessAdapter, the call to ConfigFileHelper.ReadConnectionStringFromConfig is returning an empty string. The App.config file is present with the correct key, as given by DataAccessAdapter.ConnectionStringKeyName. Any ideas?

This is with LLBLGen Pro 2.0.0.0

Regards, James.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 13-Sep-2006 12:42:16   

Please post your config file (you can remove the real connectionstring content, it's just about how the config file is setup). Also if it's a webapp, only the location of the appsettings etc. is important.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 17
Joined: 13-Sep-2006
# Posted on: 13-Sep-2006 13:30:37   

Otis,

It's nothing other than the auto-generated App.config:

<?xml version="1.0"?> <configuration> <appSettings> <add key="TWVPatCns" value="data source=localhost;initial catalog=TEST_SCHEMA;integrated security=SSPI;persist security info=False;packet size=4096"/> </appSettings> </configuration>

Best regards, James.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 13-Sep-2006 14:43:11   

First question: Is this from the config file of your application (web.config or applicationname.config) or is it from the app.config file of the generated project?

If it's the second case, then you should copy this connection string to your application config file.

Second question: is "TWVPatCns" the same as the ConnectionStringKeyName property in the llblgen pro project properties?

Posts: 17
Joined: 13-Sep-2006
# Posted on: 13-Sep-2006 15:49:20   

In reverse order:

Q2:

From above: The App.config file is present with the correct key, as given by DataAccessAdapter.ConnectionStringKeyName

simple_smile

But Q1 was the key - I was assuming the adapter would load the connection string from the generated config file.

Cheers!