[英]SQL SERVER ERROR (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I'm working on a website using ASP.NET, C# and mssql. 我正在使用ASP.NET,C#和mssql的网站上工作。 When I run the website on our local server it is working fine. 当我在本地服务器上运行网站时,它运行正常。
The following error occurs when I run it on a shared server: 当我在共享服务器上运行它时,会发生以下错误:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. 建立与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. 验证实例名称正确,并且已将SQL Server配置为允许远程连接。 (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (提供者:SQL网络接口,错误:26-指定服务器/实例时出错)
I don't know how to play with connection string now since I'm very new to this. 我现在不熟悉如何使用连接字符串,因为我对此很陌生。
It is recommend to keep the connection string in web.config. 建议将连接字符串保留在web.config中。 To create a valid connection string with SQL Server (either located on network or locally), use following steps: 若要使用SQL Server(位于网络上或本地)创建有效的连接字符串,请使用以下步骤:
Steps: 脚步:
UPDATE 更新
check following link for creating UDL http://msdn.microsoft.com/en-us/library/e38h511e(v=vs.71).aspx 检查以下用于创建UDL的链接http://msdn.microsoft.com/zh-cn/library/e38h511e(v=vs.71).aspx
check following link for connection string Setting up connection string in ASP.NET to SQL SERVER 检查连接字符串的以下链接: 在ASP.NET中设置与SQL SERVER的连接字符串
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.