Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 25th, 2007, 10:57 AM
GS GS is offline
Authorized User
 
Join Date: Sep 2003
Location: , , .
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
  #2 (permalink)  
Old March 25th, 2007, 11:00 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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.
  #3 (permalink)  
Old March 26th, 2007, 04:42 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
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.

  #4 (permalink)  
Old March 26th, 2007, 04:47 AM
GS GS is offline
Authorized User
 
Join Date: Sep 2003
Location: , , .
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
  #5 (permalink)  
Old March 26th, 2007, 05:11 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
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

  #6 (permalink)  
Old March 26th, 2007, 05:16 AM
GS GS is offline
Authorized User
 
Join Date: Sep 2003
Location: , , .
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:19 PM.


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