Down with <appSettings>!

Posts   
 
    
worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 22-Jan-2007 02:13:12   

Ok below is a modified version of daaAdapter.template (SD_DataAccessAdapterTemplate)

Just replace the ReadConnectionStringFromConfig method with this code


        private string ReadConnectionStringFromConfig()
        {
            return System.Configuration.ConfigurationManager.ConnectionStrings[ConnectionStringKeyName].ConnectionString;
            //return ConfigFileHelper.ReadConnectionStringFromConfig( DataAccessAdapter.ConnectionStringKeyName);
        }

You should also modify whatever project file template ur using (i was using vsnet2005ProfileFile.template)

add the following to your references.


<Reference Include="System.configuration" />

And you'll be free from putting ur connection string in the old school v1.1 way. Hoorah! smile

Walaa avatar
Walaa
Support Team
Posts: 14987
Joined: 21-Aug-2005
# Posted on: 22-Jan-2007 08:03:10   

Thanks for sharing,

But may I ask, what's the need for that?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39776
Joined: 17-Aug-2003
# Posted on: 22-Jan-2007 08:31:34   

Indeed, as the Configfile reader already does check for that wink (so both ways are supported)

Frans Bouma | Lead developer LLBLGen Pro
worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 23-Jan-2007 00:53:10   

It does...? Ok... flushed Nobody tells me these things.