连接字符串不起作用.无法连接到数据库 [英] Connection string not working. Could not connect to database

查看:80
本文介绍了连接字符串不起作用.无法连接到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了一个成功托管的应用程序.我已经在使用sql server 2008的服务器上购买了空间.但是我的连接无法打开到该数据库.我正在使用的连接字符串是:

I have developed an application which I have successfully hosted. I have purchased space on a server which uses sql server 2008. But my connection could not open to that database. The connection string i am using is:

this.sConnectionString = "Data Source=***.**.***.***;Initial Catalog=test;User ID=@#$%^&Password=&^%*$#"


但这给了我一个例外,说:

建立与SQL Server的连接时发生与网络相关或特定于实例的错误.服务器未找到或无法访问.验证实例名称正确,并且已将SQL Server配置为允许远程连接. (提供者:命名管道提供者,错误:40-无法打开与SQL Server的连接)

但是,当我使用相同的连接字符串连接到具有不同IP地址和其他凭据的大学服务器时,它将连接起来.请帮帮我.


But it gives me an exception saying that:

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)

But when I use the same connection string to connect to my college server which has different IP address and other credentials it gets connected. Please help me out. Why is this sot that the other server gives me an exception??

推荐答案

%^& Password =& ^%*
%^&Password=&^%*


#"


但这给了我一个例外,说:

建立与SQL Server的连接时发生与网络相关或特定于实例的错误.服务器未找到或无法访问.验证实例名称正确,并且已将SQL Server配置为允许远程连接. (提供者:命名管道提供者,错误:40-无法打开与SQL Server的连接)

但是,当我使用相同的连接字符串连接到具有不同IP地址和其他凭据的大学服务器时,它将连接起来.请帮帮我.为什么会这样,以至于另一台服务器给了我一个例外?


But it gives me an exception saying that:

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)

But when I use the same connection string to connect to my college server which has different IP address and other credentials it gets connected. Please help me out. Why is this sot that the other server gives me an exception??



这篇关于连接字符串不起作用.无法连接到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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