473,383 Members | 1,891 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,383 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 18388
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.