Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi How do i fix this Error? when i run my MVC app i get this error though my web.config is find. the error is on my DB call Sample:

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

Also cannot find ‘NT AUTHORITY\NETWORK SERVICE’. on my sql server management studio 2012 object explorer under Security > Logins to right click and set the Properties.

How can i add it, is this a win vista issue ?

share|improve this question

migrated from Jul 28 '13 at 11:20

This question came from our site for professional and enthusiast programmers.


You can't find the NT AUTHORITY\NETWORK SERVICE because it hasn't been added. You need to explicitly add it.

Goto Security-> Logins (in SSMS) and add that user. Then go to your database and add as a login with relevant permissions.

Better still, script it:



share|improve this answer
Hi Mitch i have done that and on user mapping > database role membership i set it as owner and so. but this just creates another use and i still get the same error? – user2606847 Jul 28 '13 at 15:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.