Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 25th, 2007, 10:57 AM
GS GS is offline
Authorized User
 
Join Date: Sep 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
 
Old March 25th, 2007, 11:00 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old March 26th, 2007, 04:42 AM
Authorized User
 
Join Date: Feb 2007
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

 
Old March 26th, 2007, 04:47 AM
GS GS is offline
Authorized User
 
Join Date: Sep 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old March 26th, 2007, 05:11 AM
Authorized User
 
Join Date: Feb 2007
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old March 26th, 2007, 05:16 AM
GS GS is offline
Authorized User
 
Join Date: Sep 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Many Thanks
G





Similar Threads
Thread Thread Starter Forum Replies Last Post
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGO hexOffender ASP.NET 1.0 and 1.1 Basics 2 October 24th, 2008 07:26 AM
user 'NT AUTHORITY\NETWORK SERVICE' GS ASP.NET 2.0 Basics 0 March 25th, 2007 10:58 AM
The current identity (NT AUTHORITY\NETWORK SERVICE babakwx ASP.NET 2.0 Professional 1 May 20th, 2006 10:18 PM
Login failed for user 'NT INSTANS\NETWORK SERVICE' keysersoze BOOK: ASP.NET Website Programming Problem-Design-Solution 3 April 6th, 2005 01:25 PM
SQL Server / Login failed for user 'NT AUTHORITY ElPato ASP.NET 1.0 and 1.1 Basics 2 November 14th, 2004 10:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.