Skip to main content

How do you configure data connection strings at the machine.config level?

Comments

1 comment

  • Malcolm Walker
    • Community-Manager
    Hi Sean,

     

    Connection Strings can be set at any level within the web site.  Adding a web.config file to any folder will configure IIS to add a connection string for that folder and every folder beneath it.

     

    So, putting a <connectionStrings> tag in the web.config for the viewer would work for the viewer application but since Essentials and Manager aren't contained within that folder, it won't work for Essentials.

     

    For Essentials, you may specify database connection strings in:
    • The Essentials REST and Manager web.config file
    • Any web.config file in the path /Geocortex/Essentials/InstanceName/REST
    • The system global web.config file, or
    • The system global machine.config file.
    The system global files are located in:

     

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config

     

    There is already a global connection string in the machine.config, "LocalSqlServer".  The global web.config doesn't have any connection strings element, but you can add one if you like.

     

    To check whether or not the connection string is available, use the Connection Strings applet in IIS manager to see what you have.  They will either show as "local" or "inherited".

     

    To check where they are defined, you can use the Configuration Editor applet, which lets you choose the connectionStrings section and will show you what part of the configuration tree defines the entry.

     

    Note that, as with all other elements that use a collection, and <add> tags, that anyone may <remove> an entry at any point.  This doesn't happen all that often, but it can, and the computer will obey those directives.

     

    Regards,

     

    -Malcolm
    0

Please sign in to leave a comment.