连接字符串不起作用.无法连接到数据库

编程入门 行业动态 更新时间:2024-10-27 14:31:12
本文介绍了连接字符串不起作用.无法连接到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经开发了一个成功托管的应用程序.我已经在使用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??

blog.sqlauthority. com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider错误40错误/ [ ^ ]

更多推荐

连接字符串不起作用.无法连接到数据库

本文发布于:2023-10-28 13:11:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1536731.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   连接到   不起作用   数据库

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!