Different connection strings on different computer?
Hi
I am searching for a way, to store different connection strings on
different computers.
Let me explain:
I am developing ASP.NET stuff and place connection strings right into
web.config.
Since only the conn. strings are different, I want to retain the same
web.config while having different strings.
Now, it is possible to (for example) save connection strings (or whatever
else) into different files and let web.config to point at this files.
I think I saw this method at the PDC, but forgot the magic keyword (it could
be only coffee/donuts overdose halucination).
Example of modified web.config.
....
<link 'MechineSpecific.config'>
....
Thanks,
--
Miha
Re: Different connection strings on different computer?
Seems like the simplest way would just be to preface the key with the
machine name, eg. machine1_connectionstring, machine2_connectionstring, etc.
Then you can maintain just one web.config file, and just concatenate the
local machine name together with the underscore and the name of the variable
you're interested in retrieving to get the appropriate machine-specific
value.
"Miha Markic" <miham.nospam@spamno.spin.si> wrote in message
news:3c07eda6@147.208.176.211...
> Hi
>
> I am searching for a way, to store different connection strings on
> different computers.
> Let me explain:
> I am developing ASP.NET stuff and place connection strings right into
> web.config.
> Since only the conn. strings are different, I want to retain the same
> web.config while having different strings.
> Now, it is possible to (for example) save connection strings (or whatever
> else) into different files and let web.config to point at this files.
> I think I saw this method at the PDC, but forgot the magic keyword (it
could
> be only coffee/donuts overdose halucination).
> Example of modified web.config.
> ...
> <link 'MechineSpecific.config'>
> ...
>
> Thanks,
> --
> Miha
>
>
Re: Different connection strings on different computer?
Yeah, I know that. It is a possibility, though I would prefer something
easier :)
Lazy me :)
--
Miha Markic
"Russell Jones" <arj1@northstate.net> wrote in message
news:3c07f2af@147.208.176.211...
> Seems like the simplest way would just be to preface the key with the
> machine name, eg. machine1_connectionstring, machine2_connectionstring,
etc.
> Then you can maintain just one web.config file, and just concatenate the
> local machine name together with the underscore and the name of the
variable
> you're interested in retrieving to get the appropriate machine-specific
> value.
>
> "Miha Markic" <miham.nospam@spamno.spin.si> wrote in message
> news:3c07eda6@147.208.176.211...
> > Hi
> >
> > I am searching for a way, to store different connection strings on
> > different computers.
> > Let me explain:
> > I am developing ASP.NET stuff and place connection strings right into
> > web.config.
> > Since only the conn. strings are different, I want to retain the same
> > web.config while having different strings.
> > Now, it is possible to (for example) save connection strings (or
whatever
> > else) into different files and let web.config to point at this files.
> > I think I saw this method at the PDC, but forgot the magic keyword (it
> could
> > be only coffee/donuts overdose halucination).
> > Example of modified web.config.
> > ...
> > <link 'MechineSpecific.config'>
> > ...
> >
> > Thanks,
> > --
> > Miha
> >
> >
>
>
Re: Different connection strings on different computer?
> Now, it is possible to (for example) save connection strings
> (or whatever else) into different files and let web.config to
> point at this files.
Miha: Perhaps you're thinking of UDL files? For more information see:
HOWTO: Use Data Link Files with ADO (Q189680)
http://support.microsoft.com/default...;EN-US;q189680
---
Phil Weber
Re: Different connection strings on different computer?
Hi Phil,
Yes, I was used to UDL files with VB<=6 :).
Unfortunately, SqlConnection does not support UDL files (onl OleDbConnection
supports it).
I ended up with something like Russell suggested.
Thanks,
Miha
"Phil Weber" <pweber @ fawcette.com> wrote in message
news:3c0c7b77$1@147.208.176.211...
> > Now, it is possible to (for example) save connection strings
> > (or whatever else) into different files and let web.config to
> > point at this files.
>
> Miha: Perhaps you're thinking of UDL files? For more information see:
>
> HOWTO: Use Data Link Files with ADO (Q189680)
> http://support.microsoft.com/default...;EN-US;q189680
>
> ---
> Phil Weber
>
>