日期:2014-05-18  浏览次数:20354 次

asp.net与sql2000连接问题
我的是xp系统+sql2000+.net2005
连接语句:conn.connectionstring= "database=pubs; "&   "Data   Source=127.0.0.1; "
我的数据库没设密码,用的是Windows身份验证,运行之后提示如下:

在建立与服务器的连接时出错。在连接到   SQL   Server   2005   时,在默认的设置下   SQL   Server   不允许进行远程连接可能会导致此失败。   (provider:   命名管道提供程序,   error:   40   -   无法打开到   SQL   Server   的连接)  


我用的sql2000为什么提示连接到2005上呢,怎样调整设置?还是语句本身有错误?



------解决方案--------------------
connectionstring= "database=pubs; Data Source=127.0.0.1; uid=sa; pwd=; "
------解决方案--------------------
我用的sql2000为什么提示连接到2005上呢?
因为你的sql 2000的连接没有成功。
集成验证的写法
Provider=sqloledb;Data Source=(local);Initial Catalog=pubs;Integrated Security=SSPI;
------解决方案--------------------
Provider=sqloledb;Data Source=(local);Initial Catalog=pubs;Integrated Security=SSPI;
怕麻烦的话 用sqlDataSource自动生成