用户"NT AUTHORITY \ NETWORK SERVICE"的登录失败. [英] Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

查看:91
本文介绍了用户"NT AUTHORITY \ NETWORK SERVICE"的登录失败.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友.

我在vs 2010中工作.我创建了一个应用程序,并在app_data文件夹中添加了一个.mdf文件.然后,我使用vs 2010的服务器资源管理器在.mdf文件中创建了表和存储过程.
我添加连接字符串并编写一些逻辑以将应用程序与.mdf文件连接.当我运行应用程序时,
其与数据库的连接以及插入和更新操作的效果都很好.

然后,我使用vs2010查询窗口显示所有记录.
我的客户想要在sql express管理工作室中添加.mdf文件.这样我就可以从sql express服务器中的同一位置(app_data)文件附加.mdf.附加.mdf文件后,当我运行应用程序时,它将引发以下错误.



无法打开用户默认数据库.登录失败.
用户"NT AUTHORITY \ NETWORK SERVICE"的登录失败.




每当我在sql Express Management Studio中附加.mdf文件时,就会出现上述错误.

我在Google搜索过,但尚未找到解决方案.

请帮我解决这个问题.


谢谢
Imrankhan

Hello friends.

I am working in vs 2010. I create one application and add one .mdf file in app_data folder.Then I create tables and stored procedure in .mdf file using server explorer of vs 2010.
I add connection string and write some logic to connect application with .mdf file. When I run application then
its connected with database and insert and update operation performs well.

Then I use vs2010 query window to show all records.
My client wants to add .mdf file in sql express management studio. So that I attach .mdf from same location(app_data) file in sql express server. after attaching .mdf file, when I run application, it throws following error.



Cannot open user default database. Login failed.
Login failed for user ''NT AUTHORITY\NETWORK SERVICE''.




Whenever I attach .mdf file in sql express management studio then I get above error.

I searched in googled but not find solution yet.

Please help me solve this problem.


Thanks
Imrankhan

推荐答案

为ASP_User的某些任务授予表上的权限-您的应用程序可能无权执行插入操作. -您似乎可以更新,但仅此而已.

http://msdn.microsoft.com/en-us/library/ms187965.aspx [ ^ ]
grant permissions on your tables for certain tasks for ASP_User - your application might not have access to do an insert. - this seems like the case as you can update but no more.

http://msdn.microsoft.com/en-us/library/ms187965.aspx[^]


这篇关于用户"NT AUTHORITY \ NETWORK SERVICE"的登录失败.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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