Login failed for user NT AUTHORITY\NETWORK SERVICE

G

Guest

Hi ,

I created a very simple ASP.NET application & am getting the following error:

Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

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

Source Error:
Line 70: sqlCommand1.Parameters["b"].Value=TextBox2.Text;
Line 71:
Line 72: sqlConnection1.Open();
Line 73: sqlCommand1.ExecuteNonQuery();
Line 74: sqlConnection1.Close();

I searched for this & got the reply as:
1. "add this user to the list of allowed users"
2. "add NT AUTHORITY\NETWORK SERVICE account to SQL Server for that ,
which will be in the local group. Make sure to give it the required database
access and permissions "

But how to go about doing this? Please explain coz i am new to this stuff.

Thanks
 
N

Nick Malik [Microsoft]

Your asp.net app is trying to access SQL Server using integrated security.
Since ASP.NET runs under a local non-priveleged account, it cannot do it.

In web config, in the Identity tag, set the Impersonate attribute to True,
and turn on Windows Authenticated security. Then your users will access SQL
as themselves.
If you want every access to use the same windows account, then set the
Impersonate attribute to True and provide credentials in the attributes of
the Identity tag.
(the slightly more secure way to do this is to use aspnet_setreg.)

Some links that may help:
http://support.microsoft.com/kb/306158/EN-US/

http://www.eggheadcafe.com/articles/20021211.asp

http://www.microsoft.com/resources/...ndard/proddocs/en-us/aaconidentityelement.asp

http://support.microsoft.com/kb/316989


--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top