I am accessing my server through remote desktop connection and have configured a webservice in IIS. I am able to see the methods but when I click on the button to “Invoke” I get the following error:
System.Data.SqlClient.SqlException: Login failed for user ‘SOLDev\Server02$’.
at ShareWare.Web.Service.WebAPI.Reservation.GetInfo()
Why is it taking the machine name as the user?
My windows authentication user is User1Dev.
Also my directory security in IIS is setup as follows:
- Option “Enable anonymous access” — it’s disabled
- Option “Integrated Windows Authentication” — checked off
I am using .NET framework 2.0
It’s because the web service is running as the Network Service id, not as the logged in user. You probably also need to have
<identity impersonate="true" />in your web config if you are planning to use the user’s credentials to connect to SQL Server.