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

请问:Windows身份,连接数据库问题
string   connstr   =   String.Format(@ "data   source= 'hss\hss ';initial   catalog=master;Integrated   Security=SSPI; ",   server);

                SqlConnection   con   =   new   SqlConnection(connstr);
                con.Open();

这样一个Windows身份登录的代码
在连接sql2005时候通过
连接sql2000时候不通过

------解决方案--------------------
和尚来看你了
------解决方案--------------------
try:

string connstr = String.Format(@ "data source= 'hss\hss ';initial catalog=master;Trusted_Connection =true; ", server);


PS;如果是别人电脑上的SQL2000,要确定SQL2000安装了SP4,2000要安装了2000才支持远程链接,然后要确定远程支持Windows验证

------解决方案--------------------
虾米错误哦
------解决方案--------------------
sp_grantlogin 'xxxx\aspnet '

因为你做的是授权而不是添加,要分清grant和add的区别