I had just created a window service app and it is throwing exception Login failed for user 'NT AUTHORITY\LOCAL SERVICE' I have tried to have user id and password but it does not work on it
and go through this reference SQL Server Login error: Login failed for user 'NT AUTHORITY\SYSTEM' and created a new user on that database but again that exception
3条答案
按热度按时间p4tfgftt1#
there is solution related to my problem http://www.aspdotnet-suresh.com/2010/10/cannot-open-database-requested-by-login.html
5vf7fwbs2#
Are your service and the service running on the same machine? If they are not it is not the same 'LOCAL SERVICE' user on both machine and it will not work. If they ARE on the same machine using this connection string with no username or password:
Server=localhost;1433;Database=myDataBase;Trusted_Connection=True;
wmomyfyw3#
for .Net 7.0 make sure TrustServerCertificate is available.