MS SQL Server和Web应用程序都在同一台机器上。
在web.config ,我有:
connectionString=" Server=COMPUTER_NAME\MSSQLSERVER; Database=MyDatabase; Integrated Security=true" name="ApplicationServices" providerName="System.Data.SqlClient"
我创build了一个名为MyWebsite的新Windows用户帐户。 这个帐户分配给应用程序池,我的Web应用程序正在使用它。
在SQL Server Management Studio中:
在SQL Server安全pipe理器中,所有协议都是允许的。
我仍然收到以下错误信息:
A network-related or instance-specific error occurred while establishing a connection to SQL Server' Error 26 - Error Locating Server/Instance Specified
我错过了什么吗?
连接到默认实例时,不需要指定实例名称。
只需使用COMPUTER_NAME作为服务器。
如果您只是使用本地主机而不是连接设置的服务器或实例名称,那么从长远来看,这会更容易。