sql server 2005中的问题 [英] Problem in sql server 2005

查看:105
本文介绍了sql server 2005中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在sql server 2005中遇到问题。当我点击连接按钮时,它会给出错误

建立与SQL Server的连接时发生网络相关或特定于实例的错误。找不到服务器或无法访问服务器。验证实例名称是否正确以及SQL Server是否配置为允许远程连接。(提供程序:SQL网络接口,错误:26 - 错误定位指定的服务器/实例)(microsoft sql server )。

I have problem in sql server 2005. when i click on "connect button" it gives the error
"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)(microsoft sql server).

推荐答案

检查你的代码,仔细查看你的连接字符串。

理想情况下,这将是一些配置文件因此很容易在不重新编译的情况下进行更改,但通常是因为当您从开发环境转移到生产环境时忘记更改它 - 两者通常具有非常不同的连接字符串。



如果以前从未连接过,请尝试在VS中使用服务器资源管理器窗格设置连接:

1)打开服务器资源管理器。

2)右键单击数据连接并选择添加连接

3)在随后的对话框中,选择您的DataSource和数据库,指定安全信息,然后按测试连接按钮。

4)连接工作时,按确定

5)在服务器资源管理器窗格中突出显示数据库,并查看属性窗格。将显示连接字符串的工作示例,您可以将其复制并粘贴到您的应用程序或配置文件中。
Check your code, and look closely at your connection string.
Ideally, this will be in a config file of some form so it is easy to change without recompiling, but normally it's because you forgot to change it when you moved from a development environment to production - the two normally have very different connection strings.

If you have never connected before, try setting up a connection in VS with the Server Explorer pane:
1) Open Server Explorer.
2) Right click "Data connections" and select "Add connection"
3) In the dialog that follows, select your DataSource, and database, specify the security info, and press the "Test connection" button.
4) When the connection works, press "OK"
5) Highlight your database in the Server Explorer pane, and look at the Properties pane. A working example of the connection string will be shown, which you can copy and paste into your app or config file.


这篇关于sql server 2005中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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