Quote:
One possible reason is that the DSN you have used (TEST) is defined only for the user (you), not as system DSN. So if you're running the service under different user account, it cannot see the DSN.
Great suggestion, but in my case ("SQL Anywhere 16" database) it didn’t solve the problem. A lot of trying all kind of things did not solve the problem.
So, I come with 3 work around solutions:
1. The combination "C#", "service", "SQL Anywhere 16" database gives no problem. (Tested)
2. Probably using another DB (e.g. SQL Server, ...) will solve the problem. (Not tested)
3. Forget services, and use “Task Scheduler” (see Windows Administrative Tools). It works simple and perfect for normal exe files! (Tested on "Windows Server 2019 Standard")