简体   繁体   中英

How to allow window background service to access SQL Server database?

I have background service which access my SQL Server database.

My background service working fine when I try to get a row from SQL Server database I get an exception

base {System.Data.Common.DbException} = {"Cannot open database \"test2\" requested by the login. The login failed.\r\nLogin failed for user 'NT AUTHORITY\LOCAL SERVICE'."}**

test2 is my database name.

How do I allow my background service to access SQL Server database?

grant user NT AUTHORITY\LOCAL SERVICE access to the database

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM