日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

windows身份驗證登入數據庫 iis 無法訪問數據庫

系統 3052 0

原文地址: http://www.cnblogs.com/d-xtl/archive/2011/12/27/2303890.html

System.Data.SqlClient.SqlException: 用戶'pc-2009\ASPNET' 登錄失敗的解決辦法?
今天發布網站的時候遇到這個問題,多方查詢后終于找到答案!

System.Data.SqlClient.SqlException: 用戶'pc-2009\ASPNET' 登錄失敗的解決辦法: (此處的PC-2009是我的機器名)

由于他的數據庫連接語句中沒有采用用戶名和密碼驗證,采用的是windows集成驗證,所以無法連接數據庫。

解決方法很簡單,加上ASPNET這個賬號,賦予權限即可,具體方法如下:

1、企業管理器--》安全性--》登陸--》(右鍵)新建登陸--》名稱(在列表中添加ASPNET這個用戶);

2、然后在服務器角色一欄中選擇System Administrators;

3、在數據庫訪問一欄中選擇所要訪問的數據庫,然后在下面對話框中將db_owner選上,確定即可!

----------------------------------------------------------------------------------------------------------------------------------------

風箏:

在IIS中發布WebSite,然后連接SQLServer2005,采用windows身份驗證數據庫,結果訪問數據庫時報錯,如下:

Server Error in '/PaidTimeOffUI' Application.


Cannot open database "HRPaidTimeOff" requested by the login. The login failed.
Login failed for user (ComputerName)\ASPNET'.

Description:? An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.?

Exception Details:? System.Data.SqlClient.SqlException: Cannot open database "HRPaidTimeOff" requested by the login. The login failed.
Login failed for user 'ComputerName\ASPNET'.

-------------------------------------------------------------------

上網搜,有如下解釋:

1、 http://p2p.wrox.com/book-asp-net-3-5-enterprise-application-development-visual-studio-2008-problem-design-solutio/80312-problem.html

2、...What I did to resolve this was, disable anonymous access, then enable digest authentication so IIS will look at the domain. In the realm area select or type your fully qualified domain and this should work....

http://p2p.wrox.com/book-asp-net-3-5-enterprise-application-development-visual-studio-2008-problem-design-solutio/73386-problem-compile.html

其中涉及到IIS配置,不懂~~于是按照上面方法在SQLServer中添加了ASPNET用戶,得以解決,以后一定要學些IIS配置!

2012.02.21 晚

windows身份驗證登入數據庫 iis 無法訪問數據庫


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 浙江省| 中阳县| 湘阴县| 新建县| 金川县| 天水市| 东港市| 大新县| 许昌市| 囊谦县| 钟山县| 双辽市| 淳化县| 南丹县| 苗栗县| 昌邑市| 革吉县| 七台河市| 甘孜县| 通化县| 梁山县| 鄂托克前旗| 宜春市| 阿坝| 和平区| 进贤县| 龙泉市| 长丰县| 平舆县| 泸溪县| 武城县| 新民市| 虹口区| 江山市| 乌兰浩特市| 玉龙| 沅陵县| 白城市| 班玛县| 贵港市| 尚志市|