469,890 Members | 2,091 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,890 developers. It's quick & easy.

Login failed for user NT AUTHORITY\NETWORK SERVICE

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

--
pmud
Jul 21 '05 #1
1 18168
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/d...ityelement.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.
--
"pmud" <pm**@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...
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

--
pmud

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ibrahim Mohamed El-Ganady | last post: by
reply views Thread by Freddie | last post: by
4 posts views Thread by Brett | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.