p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 2.0 Professional (http://p2p.wrox.com/forumdisplay.php?f=215)
-   -   failed for user 'NT AUTHORITY\NETWORK SERVICE' (http://p2p.wrox.com/showthread.php?t=55825)

GS March 25th, 2007 10:57 AM

failed for user 'NT AUTHORITY\NETWORK SERVICE'
 
All,

I can run my ASP .net website in Visual Studio2005 no problems. But when I package and deploy the website, onto a server (with the same SQL server database). I recieve the error:

System.Data.SqlClient.SqlException: Cannot open database "DatabaseName" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

As I can access this through code with the same database, I would expect this to work but no.

If anyobody has any ideas that would be appreciated.
G

Imar March 25th, 2007 11:00 AM

Hi there,

Take a look here: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=395

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.

nesrine March 26th, 2007 04:42 AM

Hi,

You should grant access to the 'NT AUTHORITY\NETWORK SERVICE' to do so from the enterprise manager if it is SQL 2000 or from the Management tool if it is 2005, go to your database and from the Security node choose teh Users Node then add new user then select from the general tab the Login name, then browse then check the 'NT AUTHORITY\NETWORK SERVICE'

it supposed to work now.


GS March 26th, 2007 04:47 AM

Thanks for that. I reviewed the document and found it useful.

I have changed both my virtual directory settings and SQL security settings to use Windows Authentication. I there anything I need to do after as I still recieve the same error?

Thanks in advance.
G

nesrine March 26th, 2007 05:11 AM

this is sql error, it has nothig to do with the virtual Directory or IIS, it is for granting access to the 'NT AUTHORITY\NETWORK SERVICE' which can't loging without adding it to the database logins


GS March 26th, 2007 05:16 AM

Thanks for that - I added in the user and this works now.

Many Thanks
G


All times are GMT -4. The time now is 04:47 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.