locked
Switching from IIS Express to IIS...what should I change my connection string to for the database to work properly? RRS feed

  • Question

  • User-1851576699 posted

    I am getting an 500 - internal error response when trying to view my website along with the error message: "

    "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details."

    When I move my website from the local project folder to the inetpub/wwwroot folder do I have to change my connection string in web.config to use some other than (localDb)\v11.0? My application is MVC and I am using "Code First" for my database functionality. So the databases should get created automatically from the new location when the "attachDbFileName" portion of the connection string is seen but right now it's not working. Not sure what I need to change.

    **EDIT**: Problem solved. Follow this link if you find yourself having similar problems.

    http://blogs.msdn.com/b/sqlexpress/archive/2011/12/09/using-localdb-with-full-iis-part-1-user-profile.aspx

    The only thing that wasn't true for me in the blog instructions on how to resolve this problem was a simple restart of the Web Application didn't work for me. I tried it twice. Afer that I just rebooted my computer and it resolved this specific problem.

    Thanks peeps. You can all go back to sleep now. :)

    Sunday, September 1, 2013 10:04 PM

Answers

  • User-166373564 posted

    Hi,

    Thanks for sharing your solution with us,

    **EDIT**: Problem solved. Follow this link if you find yourself having similar problems.

    http://blogs.msdn.com/b/sqlexpress/archive/2011/12/09/using-localdb-with-full-iis-part-1-user-profile.aspx

    The only thing that wasn't true for me in the blog instructions on how to resolve this problem was a simple restart of the Web Application didn't work for me. I tried it twice. Afer that I just rebooted my computer and it resolved this specific problem.

    Glad that you've solved your problem by yourself, it's recommanded to reply to your original post and post your solution when you resolve your problem. In this way, our community members will know your problem is solved, and we will focus on other threads unsolved, appreciate your understanding,

     

    Best regards

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 3, 2013 9:44 PM