Connection string in VS2010


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


    Monday, March 21, 2011 12:54 PM


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

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


    Monday, March 21, 2011 3:55 PM