关于连接数据库,遇到这样的提示,怎么弄都不行
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) 典型的连接不上的提示,数据库服务我已经启动了我的连接代码是:
SqlConnection conn=new SqlConnection("Server=localhost;database=pubs;uid=sa;pwd=''");今天看了一些连接数据库的资料,反正我今天是糊涂了,不知道怎么弄了,哎,谁让我是一个新手呢
看了那些连接数据库的字段,都不一样,我今天就看见了5钟连接SQL数据库的字段哪位高人可以给我一些详细解释吗?真的是非常感谢了,绝对非常感谢,我需要帮助......
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) 典型的连接不上的提示,数据库服务我已经启动了我的连接代码是:
SqlConnection conn=new SqlConnection("Server=localhost;database=pubs;uid=sa;pwd=''");今天看了一些连接数据库的资料,反正我今天是糊涂了,不知道怎么弄了,哎,谁让我是一个新手呢
看了那些连接数据库的字段,都不一样,我今天就看见了5钟连接SQL数据库的字段哪位高人可以给我一些详细解释吗?真的是非常感谢了,绝对非常感谢,我需要帮助......
解决方案 »
- 视频传送,求思路/方案/或者有关资料!
- 火急!!!如何用js给tabled的属性width赋值?
- 调用金山词霸的翻译功能
- object转换成string怎么转
- 有回车键取代Tab键
- 救命啊,使用BinaryReader时的问题
- 关于Repeater的问题
- [**修复下载**]大家帮忙测试小弟的软件SmartRun,小弟倾家散分!!!且在关于中显示大侠的芳名!!!
- 字符串的菜鸟问题,望大哥门帮忙
- [求助]寻找会用Salamander .NET Linker and Mini-Deployment Tool的朋友?请帮忙写个教程!
- CLSID:8856F961-340A-11D0-A96B-00C04FD705A控件问题
- 一个关于方法调用的怪问题!想法确实挺怪的
或者
SqlConnection conn=new SqlConnection("Server=127.0.0.1;database=pubs;uid=sa;pwd=");
什么问题都没有,就是连接不上.
后来同事告诉我是工程路径名不能有中文,不能包含括号.
不知道你的情况是不是这样
然后改为
SqlConnection conn=new SqlConnection("Server=localhost;database=pubs;uid=sa;pwd=");
还有要确定你的密码是正确的
试试
我想连接SQL SERVER 2000的数据库.他老说连接SQL SERVER2005失败
我机器上没装2005啊?反而有一个2000的SQL
应该怎么改设置啊?
我的C#是EXPRESS的
连接过程中不能改动DATA SCOURE选项...很郁闷