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 SERVICEaccess to the database