ASP.Net中用sqlclIEnt訪問數據庫出錯錯誤現象:login failed for user:pole\aspnet 解決辦法:在命令行運行如下命令 osql -E -S (local)\NetSDK -Q "sp_grantlogin 'POLE\ASPNET'" osql -E -S (local)\NetSDK -d Pubs -Q "sp_grantdbAccess 'POLE\ASPNET'" osql -E -S (local)\NetSDK -d Pubs -Q "sp_addrolemember 'db_owner', 'POLE\ASPNET'" 以上是對數據庫Pubs授予POLE\ASPNET用戶訪問權