Greg,

You can do that in two ways:

1. Have a configuration file for each library project and load in your main
application a particular library, based on the user's role. You can store
the connection strings in the lib's config file, respectively. However, be
aware that you will only be able to include one lib config file in your
application's config file. If you need to link multiple libraries and you
want to include config file for each one, you will hit a dead end.

2. Have all the connection strings in one place and select the required one
at run-time, based on the user's role. This is gracefully handled by the
EntLib, but if you don't want to got there (although I cannot recommend it
enough), you can build custom sections in your application's config file.
I have done this and I have a small sample. Contact me offline and I can
provide details.

Good luck,
Eddie

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] Behalf Of Gregory Miley
Sent: Thursday, March 23, 2006 11:07 AM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] [C#]: Multiple SQL Servers, Multiple
Projects

Changing it on-the-fly basically, yes. During run-time, we would like to
(if the current user belongs to certain groups: Programming, Tech,
etc... We can handle that logic elsewhere) be able to switch the data
server connection to one of several servers.

The application is basically one executable with several libraries for
the various modules we would have. Each library needs to have the same
connection as the application no matter what, but that connection needs
to be changeable during run-time.

I believe Eric may have answered it for me. Will let you all know what
we come up with. Any other suggestions in the mean-time will also be
appreciated.

Thanks,
Greg

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to