none
Connection string in VS2010

    Question

  • Before upgrading to VS2010 the website configuration tool would automatically create a connection string in web.config for the default membership database. Now, this seems to no longer be the case. So as I get ready to deploy, how can I get the proper connection string? NORE: My project seems to work fine and login and roles seem to work OK but I can't find the connection string anywhere. If I can't find it, how can I modify it for deployment?

    Thanks

    Monday, March 21, 2011 12:54 PM

Answers

  • If you do not find any connectionstring setting in your web.config, it is using the one in machines.config.  Make sure you add the following in your web.config to override the one in the machines.config:

    <connectionStrings>
        <clear/>  <!-- need to do this clear to override the one set in the Machine.config -->
        <add name="LocalSqlServer" connectionString="YourNewString" ../>

    </connectionStrings>

    Monday, March 21, 2011 3:55 PM