无法从IIS连接SQL Server 2005 [英] Unable to connect sql server 2005 from iis

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

问题描述

我无法从 windows server 2008 r2 IIS 连接 sql server 2005(远程).我可以使用相同的连接字符串从 visual studio 2010 连接此服务器和本地sql服务器. IIS服务器无法连接远程服务器.我不明白,为什么?

请帮帮我!!!



我在Web配置中使用以下连接字符串:
<添加名称=远程" connectionstring =数据源=服务器名称\实例名称;初始目录=数据库名称;集成安全性= false;用户ID =用户ID;密码= 123;" />


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

I am unable to connect sql server 2005 (remote) from windows server 2008 r2 IIS. I can connect this server from visual studio 2010 and local sql server with same connection string. IIS server failed to connect remote server. I couldn''t understand, why?

Please help me!!!



I am using the following connection string in web config :
<add name="remote" connectionstring="Data Source=server_name\instance_name;Initial Catalog=db_name;Integrated Security=false;user id=user_id; password=123;" />


Facing this 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)

推荐答案

步骤1:打开cmd并ping您的sql服务器.检查是否可用.

步骤2:创建一个DSN文件,然后尝试连接到数据库. http://antigame.com/content/support/library/data/v76/help/windows%20dsn.aspx [ ^ ]

步骤3:如果1通过,则步骤2失败.在服务器上启用TCP/IP和Namedpipe通信.

如果步骤1失败->将sql服务器放在同一局域网中
step 1: open cmd and ping your sql server. check if it is available.

step 2 : create a DSN file and try connecting to a DB . http://antigame.com/content/support/library/data/v76/help/windows%20dsn.aspx[^]

step 3 : if 1 passes and step 2 fails. enable TCP/IP and Namedpipe communication on server.

if step 1 fails --> bring the sql server on same LAN


这篇关于无法从IIS连接SQL Server 2005的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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