MSSQLLocalDB 可以在生产 Web 服务器上使用吗?
Can MSSQLLocalDB be used on production web server?
说来话长,但我有一个 Web 应用程序,它有一个 SQL 服务器数据库,可以正常工作,但也有一个 ASPNETDB.MDF 数据库(用于会员资格),它在 [=20] 下一直运行良好=] Server 2008。我在服务器上升级到 SQL Server 2014,我无法再访问 ASPNETDB.MDF 数据库并收到此错误:
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: 26 -
Error Locating Server/Instance Specified)
我已经修改了连接字符串以更新到 2014 年的预期内容并且在一个简单的控制台应用程序中工作正常(我可以连接,运行 SQL 命令等)但是我一直无法弄清楚为什么我可以让它在生产中工作。注意:它甚至不能在 Web 服务器上的浏览器中运行 - 我得到了同样的错误。
这是我的连接字符串:
<add name="DefaultConnection" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Trusted_Connection=Yes" />
说来话长,但我有一个 Web 应用程序,它有一个 SQL 服务器数据库,可以正常工作,但也有一个 ASPNETDB.MDF 数据库(用于会员资格),它在 [=20] 下一直运行良好=] Server 2008。我在服务器上升级到 SQL Server 2014,我无法再访问 ASPNETDB.MDF 数据库并收到此错误:
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: 26 - Error Locating Server/Instance Specified)
我已经修改了连接字符串以更新到 2014 年的预期内容并且在一个简单的控制台应用程序中工作正常(我可以连接,运行 SQL 命令等)但是我一直无法弄清楚为什么我可以让它在生产中工作。注意:它甚至不能在 Web 服务器上的浏览器中运行 - 我得到了同样的错误。
这是我的连接字符串:
<add name="DefaultConnection" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Trusted_Connection=Yes" />