I’m trying to connect to SQL Server using Windows authentication. The code works fine when I run it as a plain executable but when I put it in a Windows service I get the error: Login failed for user ‘NT AUTHORITY\ANONYMOUS LOGON’
I tried passing the username and password via the connection string but that doesn’t help.
Any ideas?
If you’re running as a servie, you’ll need to change the logon identity for the Windows Service.
When configuring a process to connect to Sql Server via Integrated Authentication you don’t/can’t specify the username/password combination in the connection string.