Showing posts from July, 2012

Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

Very recently I got a mail from a junior guy he faced a problem every time when he installed the SQL server database on his workstation. But he failed to understand what is the main reason behind this. The problem was that after installing SQL server database his working web sites were throws exception like this...

System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

The main reason behind this error occurs when you configured your web site with IIS. When any one tries to browse the site, IIS send the request to the SQL server with credentials. But unfortunately the credential do not have proper permission. So that it throws exception.

We can solve this problem in several ways....
First solutionthat resolved my problem was:

Login to SQL server database via SQL Server Management StudioGo to the "Security" directory of desired databaseRight-click the Users directorySelect "New User..."Add 'NT AUTHORITY\NETWORK…