Webservice fails to login to SQL Database

Answered Webservice fails to login to SQL Database

  • Thursday, August 23, 2012 1:34 AM
     
     

    I have a webservice written in C# VS2008 that is deployed to a clean install of Win 2008 R2 SP1 server.  The Webservice runs but when it tries to acces the database using LINQ DataContext I get the following error:

    System.Data.SqlClient.SqlException: Cannot open database "CALLMasterSQL" requested by the login. The login failed. Login failed for user 'IIS APPPOOL\DefaultAppPool'.

    I tried to add 'IIS APPPOOL\DefaultAppPool' to the Security settings of the SQL .MDB file but only "DefaultAppPool" shows up in the list of users no "IIS APPPOOL" entry.

    How do I get the webservice to have permission to read/write to the databse?

    This all works on my development machine which uses the exact same connection string.

    Thanks

    Morris


    Thank you Morris

All Replies

  • Friday, August 24, 2012 12:32 AM
     
     Answered

    I do not think you can add 'IIS APPPOOL\DefaultAppPool' as user in SQL server.

    • Check for the user you are runing your application having access rights on  SQL server
    • Check SQL server error log for login failure details

    Please click the Mark as Answer or Vote As Helpful if a post solves your problem or is helpful!

    • Marked As Answer by MoCoder Friday, August 24, 2012 12:56 AM
    •  
  • Friday, August 24, 2012 12:58 AM
     
     

    You are right that you can't add it since its only an internal OS account.

    I had to create anew user acct and specify it as the account to use with the webservice.  Then had add that account to SQL's security list of users.

    Thanks for your response.


    Thank you Morris