Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2008

Tip: Looking for answers? Try searching our database.

accessing connection string in data access layer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tirrell Cotton - 22 Jun 2008 03:08 GMT
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?
Peter Morris - 22 Jun 2008 18:12 GMT
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.

Signature

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

Morten Wennevik [C# MVP] - 23 Jun 2008 07:58 GMT
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.

Signature

Happy Coding!
Morten Wennevik [C# MVP]

> I've created a small n-tiered application similar to the one created in this
> demo video:
[quoted text clipped - 7 lines]
> library projects).  How can I change the connection string without
> re-compiling the project?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.