SQL SERVER ERROR(提供者:SQL网络接口,错误:26 - 错误定位服务器/实例指定) [英] SQL SERVER ERROR (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

查看:1239
本文介绍了SQL SERVER ERROR(提供者:SQL网络接口,错误:26 - 错误定位服务器/实例指定)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ASP.NET,C#和MSSQL在网站上。
当我我们的本地服务器上运行的网站它工作正常。

I'm working on a website using ASP.NET, C# and 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:

发生-特定实例的网络相关的或错误而
  与SQL Server建立连接。服务器没有被发现或
  无法访问。验证实例名称是否正确,以及
  SQL Server配置为允许远程连接。 (提供者:SQL
  网络接口,错误:26 - 错误定位服务器/实例
  指定)

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: 26 - Error Locating Server/Instance Specified)

我不知道该如何与现在连接字符串玩,因为我很新了这一点。

I don't know how to play with connection string now since I'm very new to this.

推荐答案

建议保持连接字符串在web.config中。
要创建SQL Server的一个有效的连接字符串(位于网络或本地),使用以下步骤:

It is recommend to keep the connection string in web.config. To create a valid connection string with SQL Server (either located on network or locally), use following steps:

步骤:


  1. 在您的桌面上创建一个 Test.UDL 文件。

  2. 双击该文件,以下述数据链接属性

  3. 选择供应商在你的情况即SQL Server的

  4. 提供连接的详细信息,即服务器,用户名,密码等,在连接标签。

  5. 连接选项卡,preSSOK关于
  6. 测试连接。

  7. 在记事本中打开UDL文件,看看有效的连接字符串。

  1. Create a Test.UDL file at your desktop.
  2. Double click the file to see undermentioned Data Link Properties
  3. Select provider i.e SQL Server in your case
  4. Provide connection details i.e. server, username, password etc. in Connection tab.
  5. Test Connection on connection tab and press "OK".
  6. Open UDL file in notepad to see valid connection string.

更新

以下链接创建UDL HTTP检查: //msdn.microsoft.com/en-us/library/e38h511e(v=vs.71).aspx

check following link for creating UDL http://msdn.microsoft.com/en-us/library/e38h511e(v=vs.71).aspx

检查以下链接连接字符串<一个href=\"http://stackoverflow.com/questions/5642474/setting-up-connection-string-in-asp-net-to-sql-server\">Setting起来ASP.NET到SQL Server 连接字符串

check following link for connection string Setting up connection string in ASP.NET to SQL SERVER

这篇关于SQL SERVER ERROR(提供者:SQL网络接口,错误:26 - 错误定位服务器/实例指定)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆