Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Login failed for user. The user is not associated with trusted connection

Login failed for user. The user is not associated with trusted connection

Scheduled Pinned Locked Moved ASP.NET
databasesecuritycsharpsql-serversysadmin
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Saranya B
    wrote on last edited by
    #1

    Hello Everybody... I have a web application developed in .net 2.0 which uses SQL Server 2005 as its backend. No error is thrown when I jus debug from my machine. But When I host it in IIS it is throwing the error mentioned in subject line. My connenction string in web.config file just has, server, database attributes along with integrated security is set to true... And the SQL Server is in Mixed Mode authentication. Still I face the error. PS: I could successfully browse the site if i mention some SQL Authenticated User id and password in connection string instead of integrated security... Is there anyother way without giving the sql userid? Why do we have to have the sql authenticated user? -Saran

    S K 2 Replies Last reply
    0
    • S Saranya B

      Hello Everybody... I have a web application developed in .net 2.0 which uses SQL Server 2005 as its backend. No error is thrown when I jus debug from my machine. But When I host it in IIS it is throwing the error mentioned in subject line. My connenction string in web.config file just has, server, database attributes along with integrated security is set to true... And the SQL Server is in Mixed Mode authentication. Still I face the error. PS: I could successfully browse the site if i mention some SQL Authenticated User id and password in connection string instead of integrated security... Is there anyother way without giving the sql userid? Why do we have to have the sql authenticated user? -Saran

      S Offline
      S Offline
      SHatchard
      wrote on last edited by
      #2

      If you use authenticated security in a .net application then then connection will be made in the context of the process account IUSR_MachineName most probably. It is unlikely that user has access to the sql server and I wouldnt recommend that you add it. I would suggest using a sql login from the web site rather than integrated authenication.

      1 Reply Last reply
      0
      • S Saranya B

        Hello Everybody... I have a web application developed in .net 2.0 which uses SQL Server 2005 as its backend. No error is thrown when I jus debug from my machine. But When I host it in IIS it is throwing the error mentioned in subject line. My connenction string in web.config file just has, server, database attributes along with integrated security is set to true... And the SQL Server is in Mixed Mode authentication. Still I face the error. PS: I could successfully browse the site if i mention some SQL Authenticated User id and password in connection string instead of integrated security... Is there anyother way without giving the sql userid? Why do we have to have the sql authenticated user? -Saran

        K Offline
        K Offline
        kubben
        wrote on last edited by
        #3

        If you still want to use integrated security to access sql server you will need to do a few things. First set up a new app pool in IIS. Point your web app to use this app pool. Next create a network login for the app pool. Set the identity of the app pool as the network user. On the web server add the new user to the IIS_WPG group Make sure the user has the correct read and write rights to the directories that your web app are in. Finally make sure this network user has the correct rights in sql server so the web app will run. Hope this helps. Ben

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups