PC Review


Reply
Thread Tools Rate Thread

Connection String question - accessing one string throughout solut

 
 
=?Utf-8?B?Z2FyeSBnLg==?=
Guest
Posts: n/a
 
      26th Apr 2006
I was wondering if it was possible to store a connection string only once in
a single config file, and let it be accessible to every project in the
solution (web included). This way if the connection string needs to be
altered, it only needs to be changed in one place without having to worry
about consistency issues. Thanks for any help.
 
Reply With Quote
 
 
 
 
AMDRIT
Guest
Posts: n/a
 
      26th Apr 2006
If all the applications are on one computer, you could use machine.config.
If not, then you would have a mess of dependency issues, the server that the
file is stored on, would always have to be up and accessible and then it
wouldn't be an app/web config file. Rather, it would be a simple text file
with the connection string stored in it.

Additionally, environmental settings shouldn't be simply changed without a
process for testing the affect. That is why when the config files are
changes (winform and webform) the assembly spawns a new instance of itself
and orphans existing instances.

Certainly you can achieve as you ask, I only caution the feasibility.

Create a text file or xml file. Place it on a common store, have the
applications parse the file to get the connection string.

"gary g." <gary g.@discussions.microsoft.com> wrote in message
news:6E4085E3-DFCF-4947-9B11-(E-Mail Removed)...
>I was wondering if it was possible to store a connection string only once
>in
> a single config file, and let it be accessible to every project in the
> solution (web included). This way if the connection string needs to be
> altered, it only needs to be changed in one place without having to worry
> about consistency issues. Thanks for any help.



 
Reply With Quote
 
=?Utf-8?B?Z2FyeSBnLg==?=
Guest
Posts: n/a
 
      26th Apr 2006
Thanks for the reply. Just a little more background info on how my solution
is set up... The entire solution consists of many different projects, each
with their own separate .dll's and assembly info. Considering this, would it
still be possible to do as you suggested?


"AMDRIT" wrote:

> If all the applications are on one computer, you could use machine.config.
> If not, then you would have a mess of dependency issues, the server that the
> file is stored on, would always have to be up and accessible and then it
> wouldn't be an app/web config file. Rather, it would be a simple text file
> with the connection string stored in it.
>
> Additionally, environmental settings shouldn't be simply changed without a
> process for testing the affect. That is why when the config files are
> changes (winform and webform) the assembly spawns a new instance of itself
> and orphans existing instances.
>
> Certainly you can achieve as you ask, I only caution the feasibility.
>
> Create a text file or xml file. Place it on a common store, have the
> applications parse the file to get the connection string.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
accessing connection string in data access layer Tirrell Cotton Microsoft Dot NET Framework Forms 2 23rd Jun 2008 07:58 AM
Connection String for accessing Sybase and Access Form =?Utf-8?B?QW51bGFz?= Microsoft Access VBA Modules 2 19th Oct 2006 02:36 PM
Accessing repository connection string via DSO MAF Microsoft C# .NET 0 28th Mar 2006 12:21 AM
Accessing Connection String from appSettings Vijayata Microsoft C# .NET 3 23rd Jan 2006 11:00 AM
accessing string buffer posessed by System::String class directly? Bae,Hyun-jik Microsoft VC .NET 2 25th Aug 2005 06:47 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:44 AM.