防火墙出现问题时,Asp.net应用程序无法连接到SQL数据库 [英] Asp.net application not connect to SQL database when firewall enbled

查看:64
本文介绍了防火墙出现问题时,Asp.net应用程序无法连接到SQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我已将Web应用托管到我们的生产服务器.
然后尝试将应用程序连接到SQL Server 2005数据库.

如果禁用了防火墙,则应用程序将连接.
但是如果启用了防火墙,则无法连接,并显示以下错误消息:

建立与SQL Server的连接时发生了与网络相关或特定于实例的错误.找不到服务器或无法访问该服务器.请验证实例名称正确且SQL Server已配置为允许远程连接.(提供者: SQL网络接口,错误:26-错误指定服务器/实例的位置)"


我在web.config文件中的连接字符串是:
< add key ="connectionString" value ="uid = username; pwd = Password; Database = Databasename; Server = Servername \ Databasename; Persist Security Info = true;"/>

请告诉我.
感谢您的帮助...

Hi All,


I have hosted web applicatio to our production server.
then tried to connect application to the SQL server 2005 database.

application get connected if firewall is disabled.
but it could not connected if firewall is enabled, It gives error message as below:

"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)"


My connection string in web.config file is:
<add key="connectionString" value="uid=username;pwd=Password;Database=Databasename;Server=Servername\Databasename;Persist Security Info=true;"/>

please advise me.
appreciate your help...

推荐答案

请检查下面的链接.

1. 要检查的7件事,以解决在建立与SQL Server…" [^ ].
2. 提供者:SQL网络接口,错误:26 -错误定位指定的服务器/实例 [ ^ ].
Please check the links below.

1. 7 things to check to resolve "A network-related or instance-specific error occurred while establishing a connection to SQL Server…"[^].
2. provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified[^].



在防火墙中为"sqlservr.exe"和"sqlbrowser.exe"添加例外

SQL Server 2005中的路径:
C:\ Program Files \ Microsoft SQL Server \ 90 \ Shared \ sqlbrowser.exe
C:\ Program Files \ Microsoft SQL Server \ MSSQL.1 \ MSSQL \ Binn \ sqlservr.exe
Hi,
Add exception for "sqlservr.exe" and "sqlbrowser.exe" in your firewall

Path in SQL Server 2005 :
C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn \sqlservr.exe




检查启用了ur 2005应用程序的sql 2005端口


Check ur sql 2005 port enabled for using thro'' ur application


这篇关于防火墙出现问题时,Asp.net应用程序无法连接到SQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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