473,412 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

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 18389
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Coy | last post by:
I've added the ASPNET user to my local SQL Server 2000, but I still get an unhandled exception: Login failed for user 'C594891-A\ASPNET'. This is when using a web service. A similiar ASP.NET...
1
by: Ibrahim Mohamed El-Ganady | last post by:
Mr : I have proplem with Visual stdio 2003 and Windows2003 Enterprise Server , when I developed web application using ASP.Net (VB) that establish connection to SQL Server database the following...
3
by: Evan Camilleri | last post by:
I have a problem for a Windows Service to login on an SQL server (different machine) - neither Windows Authentication nor SQL Authentication worked. LOGIN FAILED FOR USER sa (for example). If...
1
by: pmud | last post by:
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:...
1
by: TOLI | last post by:
Where do a set the right user rights for ASP.NET 2 to connect to a SQL service Se below // Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\NETWORK...
10
by: musosdev | last post by:
Wonder if someone can help! We're getting the following error on our Intranet system as soon as we login.. ------------------ Exception Details: System.Data.SqlClient.SqlException: Login...
0
by: Freddie | last post by:
this is surely the wrong group, but you guys have been so helpful in the past ... i want to use the new forms authentication in asp.net 2.0 with sql server 2005 dev edition so i created a...
10
by: BLUE | last post by:
I'm using SQL Server 2005 Developer Edition on Windows XP SP2 with this setting: <add name="SqlServerTrustedConn" providerName="System.Data.SqlClient" connectionString="Data...
4
by: Brett | last post by:
I have an ASP.NET 2.0 application that uses Forms Authentication. The startup page contains just a login control, and the site works well on an IIS 6 web server. I am now setting the site up on...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.