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

  • Thread starter Abhishek Srivastava
  • Start date
A

Abhishek Srivastava

Hello All,

I have had this problem many times. Most of the times I have blindly
added all possible permissions combinations untill it got solved (many
times I just added asp.net account to the administrator groups).

But this time I am working on a server machine and therefore I cannot
add all the possible combinations of permissions.

The error comes everytime my ASP.Net application tryies to connect to
SQL Server.

So far the only permission I have added is

1. Went inside enterprise manager.
2. Under the node of my SQL server I opened Security, Logins
3. right clicked and said new login
4. in the name said nt229141\aspnet
gave access to only BlogDB database (which is the one used by my
application.)

A popup came up saying that aspnet has not been given access to the
default database. So he would not be able to access the default
database.

I proceeded since this application only needs to access BlogDB.

What is it which I didn't do correctly? Why am I still getting access
denied?

I am using Windows 2003 server.

regards,
Abhishek.
 
W

William Ryan

This is from Bill Vaughn's Post from a few days back... HTH


"Sure you can. When you use Integrated Security=SSPI with an IIS/ASP
application, the system logs you in using the ASPNET account which must be
granted permission to access the database resources.

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
A

Abhishek Srivastava

Thank you William for your reply.

One thing I wanted to make sure that the process which I have taken to
grant access to the ASP.NET account to the Database resources (my
Database BlogDB) is that process correct or not. I will be very
gratefull if you could clarify that.

Also What is the difference between trusted_connection=yes and
Integrated Security=SSPI?

Thanks again for your reply. Please give me some clarification on
these two points.

regards,
Abhishek.


Integrated Security=SSPI
 

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