Depending on how you deploy, an App.Config file might do
the trick. You can specify the connection string there,
and you can edit it programatically if need be.
In my experience, the GAC is a great tool, but it's for
totally decoupled objects, or at least ones that have
configurable properties. But a config file can hold this
stuff, be edited manually or programatically, and add a
great deal of flexibility.
Where I work, we have added some Data Access libraries
but have at least two failsafe servers in case one goes
down. In our primary .dlls (we only deploy in house so
hard coding isn't all that impractical) we have the
ConnectStrings hard coded. However, we have exception
handlers that test for things like connection timeouts.
We just recently went to sending the updates to
MessageQueues where we can catch up, but for a good 9
months we specified backup servers in config files and
the exception code would try each of the standby's in
succession. Before we went to the MSMQ , we had a local
web service that would specify the standby server name,
so we could modify the return value that the app checked
for and updated the config files.
Hopefully this gives an idea or too. And BTW, anyone
using .NET isn't 'too old school' :-)
Good Luck,
Bill
>-----Original Message-----
>G'day all,
>I am writting a variety of applications that will be
>deployed to a variety of computers and servers on the
>network. I have created a class that will access a
>database to get the name and location of our email
>server, the connection string for any specific project
>etc. My thinking is that if any of the server change i
>don't want to change all the applications. I could just
>maintain 1 connection string per box. However i don't
>know how to drop an assembly on a machine and have all
>applications reference it. I am accustom to late binding
>it and making sure it was registered on all
>machines...now i am stumped...i have added it to the GAC
>but i still don't know what to do with it from there.
>
>Suggestions?
>
>Thanks.
>.
>
|