I am assuming that you are:
- Running the WCF service in IIS
- Using a connection string that spesifies trusted connection
- Default web.config and IIS settings
In this case it will be the identity of the application pool that will be used to access that database. By default this is a local user so it will not have access to the database.
There are several ways you can fix this:
- A connection string that specifies user name and password
- Change the identity of the app pool to a domain user that has access to the database
- spesify impersonate = true and call the WCF service with a user that has access to the database
...
EDIT 1
The error that you are getting after you turn off IIS anonymous authentication is due to you not sending user information with your request, which means that you get a challenge response back. This requires changes to your WCF configuration. In your case the easiest thing to do is to specify the username and passord in the connection string.