Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Moran 285 posts 934 karma points
    Nov 08, 2012 @ 12:33
    Moran
    0

    Changing the connection string location

    Hi

    I see that the connection string is located in the Web.Config file under:

    <appSettings>

        <add key="umbracoDbDSN" value="data source=ORAN-PC\SQLEXPRESS;integrated security=True;persist security info=False;initial catalog=ActivenetDB" />

    </appSettings>

    usually I would create another config file and change the connction string loaction with config source attribute, but I can't do it here. Is there any way I can do this?

  • Moran 285 posts 934 karma points
    Jan 06, 2013 @ 17:06
    Moran
    0

    Still need some help with this :( if any one has any pointers for me it'll be great.

  • Dallas 132 posts 404 karma points
    Jan 08, 2013 @ 20:42
    Dallas
    1

    hi Moran

    You can put the AppSettings config items in an external file by adding the file attribute to the appSettings element.

    For example 

      <appSettings file="appSettings.config">
        <-- UmbracoDbDSN in external file -->
        <add key="umbracoConfigurationStatus" value="4.7.1.1"/>
        etc

    The appSettings.config file will then look like

    <?xml version="1.0"?>
    <appSettings>
         <add key="umbracoDbDSN" value=" --Connection String-- "/>
    </appSetting>
    

     

    Dallas

  • Moran 285 posts 934 karma points
    Jan 09, 2013 @ 08:28
    Moran
    0

    Thanks, won't this will force me to move all my appSettings to this file? I don't know if one of the extentions that I am using or will install will need this appSetting section and it will fail.

     

  • Dallas 132 posts 404 karma points
    Jan 09, 2013 @ 12:59
    Dallas
    100

    No, you can have the connection string in the AppSettings.config, and the rest of the AppSettings config values remain in the web.config. Any value in the external file will override the web.config values if the value exists in both.

    http://code.commongroove.com/2007/09/28/override-appsettings-with-the-file-attribute/

  • Moran 285 posts 934 karma points
    Jan 09, 2013 @ 13:56
    Moran
    0

    Thanks man this is what I have been searching for :)

Please Sign in or register to post replies

Write your reply to:

Draft