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 8550491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:57:43+00:00 2026-06-11T13:57:43+00:00

I’m getting the following error in my ASP.NET web application in IIS when running

  • 0

I’m getting the following error in my ASP.NET web application in IIS when running in Windows XP. I’m using Windows Authentication within the web application. I would normally use SQL Server Authentication (with mixed mode), but I do not have access to this database server, except read permissions. They only allow Trusted Connections (or Integrated Security=SSPI;) meaning using our Windows network authentication user.

Error:

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

.NET Code:

SqlConnection conn = new SqlConnection(
    "server=server_name;" +
    "Integrated Security=SSPI;" +
    "database=db_name;" +
    "connection timeout=30;");
SqlDataReader rdr = null;
List<Ticket> list = new List<Ticket>();

try
{
    conn.Open();
    SqlCommand cmd = new SqlCommand("SELECT TOP 10 [HEATSeq],[AssignedBy] FROM [dbo].[Asgnmnt]", conn);
    rdr = cmd.ExecuteReader();
    while (rdr.Read())
    {
        Ticket record = new Ticket();

        record.ticket_id = rdr[0].ToString();
        record.assigned_by = rdr[1].ToString();
    }
}
catch (Exception e)
{
    string x = "";
}
finally
{
    if (rdr != null)
    {
        rdr.Close();
    }
    if (conn != null)
    {
        conn.Close();
    }
}

It’s the same type of issue that I answered in Jon Skeet’s first question here. In Windows 7, you’d normally set the application pool to run using LOCAL MACHINE or NETWORK SERVICE (if you choose not to use SQL Server Authentication). Except I don’t know where to change the user of the application pool in IIS 6.

User permission error when accessing "user instance" database from ASP.NET

I read this article, but this applies to IIS in Windows 7, not Windows XP. How can I resolve this in Windows XP. Note that when I run this code in a console application, it connects fine.

http://blogs.msdn.com/b/sql_protocols/archive/2008/05/03/understanding-the-error-message-login-failed-for-user-the-user-is-not-associated-with-a-trusted-sql-server-connection.aspx

  • 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-06-11T13:57:44+00:00Added an answer on June 11, 2026 at 1:57 pm

    Found the answer in MSDN.

    http://msdn.microsoft.com/en-us/library/ab4e6cky(v=vs.80).aspx

    In case the URL changes in the future, I’m pasting the text below from the documentation above. Fickle’s answer is correct if dealing with Windows 7. From what I’m reading, you must give privileges to your computer’s machine (running IIS in Windows XP) on the remote machine running SQL Server. I found it easier to just ask the DBA of SQL Server to create an account for me to log in via SQL Server authentication.

    =====================

    This error can take a variety of forms, including:

    Login failed for user ‘(null)’

    Login failed for user domain\username

    Login failed for user computer\ASPNET

    The likely cause is that you are working with a Web application and are trying to access a computer running Microsoft SQL Server. The specific error or exception that is raised depends on whether the Web server is also running SQL Server. This problem arises because the Web application is not passing valid credentials to SQL Server. In general, you can resolve this issue by doing the one of the following:

    • If the Web server is also running SQL Server, give the local ASPNET user login privileges (Windows 2000 and Windows XP) or give the NT AUTHORITY\NETWORK SERVICE login privileges (Windows Server 2003) on the server.

    • If SQL Server is running on a remote computer and the Web server is running IIS 6.0, give the Web server’s machine account login privileges on the remote computer. The machine account is referenced as DOMAIN\MACHINENAME$.

    • Set up ASP.NET to run as a Windows domain user who has login privileges on the computer running SQL Server.

    • Use a connection string to use SQL Server standard security. To do this, you must configure the connection string with an explicit user ID and password.

    For more information, see Accessing SQL Server from a Web Application.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.