位置:海鸟网 > IT > ASP.NET >

asp.net中用sqlclient访问数据库出错解决办法

asp.net中用sqlclient访问数据库出错
错误现象:login failed for user:poleaspnet
解决办法:在命令行运行如下命令
osql -E -S (local)NetSDK -Q "sp_grantlogin 'POLEASPNET'"

osql -E -S (local)NetSDK -d Pubs -Q "sp_grantdbaccess 'POLEASPNET'"
osql -E -S (local)NetSDK -d Pubs -Q "sp_addrolemember 'db_owner', 'POLEASPNET'"
以上是对数据库Pubs授予POLEASPNET用户访问权