Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 309885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:46:58+00:00 2026-05-12T07:46:58+00:00

My ASP.NET v3.5 web application is throwing the following exception when it attempts to

  • 0

My ASP.NET v3.5 web application is throwing the following exception when it attempts to open a connection to a SQL Server 2008 database:

System.Data.SqlClient.SqlException:
Cannot open database "MyDbName"
requested by the login. The login
failed. Login failed for user ‘NT
AUTHORITY\IUSR’.

The thing is, I’ve added NT AUTHORITY\IUSR to the server’s list of logins, and to the database’s list of users. For the server, I’ve granted the user the Public role, and for the database I’ve granted db_datareader permissions.

I’ve also granted the same for NT AUTHORITY\NETWORK SERVICE, which is the identity that the application pool is running under.

The web application is hosted by IIS7, if that makes a difference. The problem repros when the DB and IIS are on the same physical machine as well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:46:58+00:00Added an answer on May 12, 2026 at 7:46 am

    The trick here is that NT AUTHORITY\NETWORK SERVICE actually appears to the database as DOMAINNAME\MACHINENAME$ (note the $ sign!). That is, when you cross the machine boundary from your web server to the SQL Server, SQL Server sees the machine account if you use the NETWORK SERVICE or LOCAL SYSTEM accounts. If you use any other non-domain account, SQL Server will not receive your credentials.

    I’m a bit puzzled by your error message. Truth be told, I don’t think that when the DB is on another box, you’ll see anything other than Login Failed for NT AUTHORITY\ANONYMOUS LOGON.

    IUSR is used for anonymous websites, and can’t pass over the wire to SQL Server. You may find a way for it to work if you’re doing everything on the same machine, but I’d never know because I’d never do it that way… 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp.net web application written in C# using a SQL Server 2008
I have an ASP.NET Web Application using SQL Server 2008. When a post code
I like to host asp.net web application in IIS 7.0 (windows server 2008). I
I have currently moved my asp.net 4.0 web application onto IIS7 (windows 2008 server).
Suppose you have the following... An ASP.NET web application that calls a stored procedure
NET web application and a WCF Application that share the same ASP.NET membership database.
I'm developing an ASP.NET web application using Visual Studio 2010 professional and a SQL
Our Asp.net web application is using LINQ-to-SQL (Stored Procs are dragged on dropped on
I am debugging an ASP.NET web application using Windbg. I am following this process
I am running an ASP.Net web application on an IIS server that needs to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.