accessing connection string in data access layer

  • Thread starter Thread starter Tirrell Cotton
  • Start date Start date
T

Tirrell Cotton

I've created a small n-tiered application similar to the one created in this
demo video:

http://windowsclient.net/learn/video.aspx?v=14625&CommentPosted=true#commentmessage

The application has all of it's data access code in a seperate class library
that uses strong typed datasets and table adapters. This class library also
contains an app.config file that stores the connection string to the
database. When the project is deployed it is a .dll file (like all class
library projects). How can I change the connection string without
re-compiling the project?
 
Change myapplication.exe.config and the app doesn't need to be recompiled,
but you do need to read the string using the ConfigurationManager class.


--
Pete
=========================================
I use Enterprise Core Objects (Domain driven design)
http://www.capableobjects.com/
=========================================
 
Hi Tirrell,

The executing application needs to have a application config/web.config file
which copies the app settings from the dll. This needs to be copied exactly
or the dll will revert to the default setting. In case of user or application
settings remember to copy the sectiongroup as well.
 
Back
Top