SQL Server实例错误 [英] Sql Server Instance error

查看:177
本文介绍了SQL Server实例错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行我的Web应用程序,其中连接字符串位于Web服务器的位置,并且该应用程序在本地运行,那么它可以正常工作,但是将应用程序上传到Web服务器后,它给出了错误
"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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server"

我已经检查了所有连接字符串,但是本地服务器上没有建立连接
注意:-在该应用程序中,我有另一个库项目,因此我有一个web.config和一个app.config,但是两者中的连接字符串相同,仍然无法正常工作.任何帮助将不胜感激.
谢谢

I am running my web application where the connection string is of the Web server and the application is running locally ,then it works fine but after uploading the application on Web server 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server"

I have checked all the connection string but there is no connection is made on local server
Note:- In the application I have another library project and so I have one web.config and one app.config but the connection string in both of them is same,Still its not working.Any help will be appreciated.
Thanks

推荐答案

消息错误准确地告诉了您需要做什么:Verify that the instance name is correct and that SQL Server is configured to allow remote connections

对SQL Server连接问题进行故障排除 [为SQL Server启用TCP/IP网络协议 [配置Windows防火墙以允许SQL Server访问 [ ^ ]
The message error is telling exactly what you need to do: Verify that the instance name is correct and that SQL Server is configured to allow remote connections

Troubleshooting SQL Server Connection Problems[^]
Enable TCP/IP Network Protocol for SQL Server[^]
Configure the Windows Firewall to Allow SQL Server Access[^]


Sumit,

如果您的数据库在其他服务器(访问远程数据库)中,则首先从sql server management studio中启用sql server形式的sql server属性的远程访问,并启用以TCP/IP命名的管道形式sql server配置管理器.

希望这对您有所帮助.

问候,
RK
Hi Sumit,

if your database in other server(access remote database) then first of enable remote access of sql server form sql server property from sql server management studio and enable TCP/IP named pipe form sql server configuration manager.

Hope this helps you a bit.

Regards,
RK


只需检查托管应用程序的Web服务器,
似乎您的Web服务器无法使用您提供给连接字符串的连接信息来访问数据库.
有时,当数据库位于不同的服务器上并且您的Web服务器被限制在那里访问时,或者您的数据库服务器和Web服务器都位于不同的网络中.您的错误消息表明您的Web服务器无法访问您的数据库,因此请检查您的网络连接,并检查是否允许您的数据库通过网络进行浏览.

Just check your web server where your hosted your app,
its seems like your web server is not able to access your database using connection information your provided to your connection string.
Some times, when database is located to different server and your web server is restricted over there to access or your database server and web server both are in different networks. your error message shows that your web server is not able to access your database, so please check your network connection and also check that your database is allowed to browser over network or not.

http://blogs.msdn.com/b/sqlblog/archive/2009/07/17/how-to-configure-sql-server-to-listen-on-different-ports-on-different-ip-addresses.aspx[^]


这篇关于SQL Server实例错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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