日期:2014-05-19  浏览次数:20639 次

VS2005连接到sqlserver2000(非默认实例NOone)
我先安装了sql   server   2000   然后在安装了VS2005   但是执行连接语句的时候出现如下情况,不知道是不是连接语句连接到非默认实例的时候会不一样的,原来是这么写的server=127.0.0.1;database=Dnyy;uid=sa;pwd=sa;

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)
      请指教!非常感谢!

------解决方案--------------------
server=127.0.0.1\实例名;database=Dnyy;uid=sa;pwd=sa;




server=.\实例名;database=Dnyy;uid=sa;pwd=sa;