无法打开数据库“aspnetdb”登录请求。登录失败。用户'NT AUTHORITY \ NETWORK SERVICE'登录失败。 [英] Cannot open database "aspnetdb" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

查看:105
本文介绍了无法打开数据库“aspnetdb”登录请求。登录失败。用户'NT AUTHORITY \ NETWORK SERVICE'登录失败。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,请帮助我一些人,我正在使用Windows 7,我已经设置了我的IIS,我安装了一个应用程序,所以我可以在我的浏览器上查看它,如localhost / me / default.aspx。

它运行正常,但是当我想登录时显示此错误

Good day all, Please can some one help me out here, i am using windows 7 and i have setup my IIS, I installed an application so i can view it on my browser like this localhost/me/default.aspx.
it worked fine, but when ever i want to log in it shows this error

Cannot open database "aspnetdb" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.







<pre lang="c#">
// my connection string is this
<connectionStrings>
       <add name="ASPNETDBConnectionString" connectionString="Data Source=localhost;Integrated Security=sspi; initial catalog=aspnetdb; User Instance=False"
            providerName="System.Data.SqlClient" />
    </connectionStrings>





i已转到C:\inetpub \ www.root\me,点击了物业,安全,网络服务......我启用了读取,写入和修改。当我预览它仍然显示相同的错误...

我的数据库在同一文件夹App_Data ..



请有人帮帮我在这里



i have gone to C:\inetpub\wwwroot\me, clicked on property, Security, Network Service... I have enabled the Read, Write, and Modify. when I preview it is still showing same Error...
My database is on same folder App_Data..

Please can someone help me out here

推荐答案

您需要将网络服务用户添加到SQL数据库中的授权用户。
You need to add the Network Service user to the authorized users in the SQL database.


在ApplicationPoolIdentity下你会找到本地系统。这将使您的应用程序在NT AUTHORITY \ SYSTEM下运行,默认情况下这是数据库的现有登录。



http://stackoverflow.com/questions/7698286/login-failed-for-user-iis- apppool-asp-net-v4-0 [ ^ ]



,所以只需选择应用程序池 - >泳池入口 - >高级设置...(来自编辑应用程序池部分) - >过程模型(来自高级设置对话框)



http:/ /forums.asp.net/t/1510479.aspx [ ^ ]



http ://blog.igorware.com/login-failed-for-user-iis/ [ ^ ]



http://www.aspdotnet-suresh.com/2011/05/systemdatasqlclientsqlexception-login.html [ ^ ]



just问题是你有没有权限使用数据库的用户......:)
Under ApplicationPoolIdentity you will find local system. This will make your application run under NT AUTHORITY\SYSTEM, which is an existing login for the database by default.

http://stackoverflow.com/questions/7698286/login-failed-for-user-iis-apppool-asp-net-v4-0[^]

, So just select Application Pool -> a pool entry -> Advanced Settings... (from Edit Application Pool section) -> Process Model (from Advanced Setting dialog box)

http://forums.asp.net/t/1510479.aspx[^]

http://blog.igorware.com/login-failed-for-user-iis/[^]

http://www.aspdotnet-suresh.com/2011/05/systemdatasqlclientsqlexception-login.html[^]

just the matter is you have the user which does not have authority to use the database,......:)


这篇关于无法打开数据库“aspnetdb”登录请求。登录失败。用户'NT AUTHORITY \ NETWORK SERVICE'登录失败。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆