我将我的MVC4网站放在运行IIS7.5(.NET4.0)的DEV服务器上,它可以正常指向服务器数据库或指定为[Machine Name] [Sql Instance]的我自己的本地数据库。应用程序在服务帐户下运行的应用程序池中。我确保用户已将该服务帐户添加到其SQL登录名并获得dbo权限。
当我更改连接字符串以使用其他用户的机器,并指定[机器名] [sql实例]时,它会抛出错误。
错误说:
[SqlException (0x80131904): 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: 25 - Connection string is
not valid)]
[EntityException: The underlying provider failed on Open.]
[HttpException (0x80004005): Error executing child request for handler
'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.]
这是连接字符串:
<add name="ProjectUI" connectionString="metadata=res://*/ViewModels.
ProjectUI.csdl|res://*/ViewModels. ProjectUI.ssdl|res://*/ViewModels.
ProjectUI.msl;provider=System.Data.SqlClient;provider connection string="data
source=MYMACHINEID\MSSQLSERVER;initial catalog=DBName;integrated
security=True;MultipleActiveResultSets=True;App=EntityFramework""
providerName="System.Data.EntityClient" />
我尝试的事情:
答案 0 :(得分:0)
有效的设置组合: