Different connection strings on different computer?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Different connection strings on different computer?

Hybrid View

  1. #1
    Miha Markic Guest

    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



  2. #2
    Russell Jones Guest

    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
    >
    >




  3. #3
    Miha Markic Guest

    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
    > >
    > >

    >
    >




  4. #4
    Phil Weber Guest

    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



  5. #5
    Miha Markic Guest

    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
    >
    >




  6. #6
    Join Date
    Apr 2004
    Posts
    59

    connection string

    i found a great website for connection string hope it would be helpfull to you

    http://www.connstr.com

    Regards
    Humair
    http://www.connstr.com
    Last edited by Humair; 06-19-2006 at 09:53 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center