连接到SQL SERVER 2008 r2时遇到问题 [英] Facing problem while connecting to SQL SERVER 2008 r2

查看:112
本文介绍了连接到SQL SERVER 2008 r2时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





i连接到SQL SERVER 2008 r2时遇到问题,它显示以下内容



Hi,

i am facing problem while connecting to SQL SERVER 2008 r2 and it is displaying the following content

TITLE: Connect to Server
------------------------------

Cannot connect to xxxxxxx\SQLEXPRESS.

------------------------------
ADDITIONAL INFORMATION:

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, Error: -1)


------------------------------





我尝试了什么:



i已经打开服务并自动启动SQL服务器并单击应用并确定...仍然收到相同的消息..



What I have tried:

i had opened services and start SQL server automatically and clicked apply and ok... still getting the same message..

推荐答案

尝试使用服务器资源管理器窗格在VS中设置连接:

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

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

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

4)当连接工作时,按确定

5)在服务器资源管理器窗格中突出显示数据库,然后查看属性窗格。将显示连接字符串的工作示例,您可以将其复制并粘贴到您的应用程序或配置文件中。



如果您无法建立连接方式,那么你需要仔细查看你的数据库的位置,以及你需要提供什么才能访问它。
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.

If you can't establish a connection that way, then you need to look carefully at where your DB is, and what you need to provide in order to access it.


>转到 SQL Server配置管理器

>确保 SQL Server Browser 配置为自动启动并启动。



>转到 SQL Server配置管理器

> SQL Server服务

>右侧窗口显示可能停止的所有服务器。

>右键单击 SQL Server 并开始。

>连接到服务器



您也可以借助以下链接: SQL Server错误的原因26并知道如何修复错误26 [ ^ ]
> Go to SQL Server Configuration Manager
> Make sure that the SQL Server Browser was configured to start automatically and was started.
or
> Go to SQL Server Configuration Manager
> SQL Server Services
> Right Side window show all the servers which may stop.
> Right click on SQL Server and start.
> Connect to server
or
You can also take the help of this link: Reasons of SQL Server Error 26 and know how to fix Error 26[^]


you need to start this two services in SQL SERVER CONFIGURATION MANAGER.
1. SQL Server(MSSQLSERVER)
2. SQL Server Browser

And one more thing you need to enable the Protocols for MSSQLSERVER

Shared Memory   Enabled
Named Pipes     Enabled
TCP/IP          Enabled
VIA             Disabled


这篇关于连接到SQL SERVER 2008 r2时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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