如何允许窗口后台服务访问SQL Server数据库? [英] How to allow window background service to access SQL Server database?
问题描述
我有访问我的SQL Server数据库的后台服务.
I have background service which access my SQL Server database.
当我尝试从SQL Server数据库获取行时,我的后台服务运行正常我有一个例外
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} ={无法打开数据库\"test2 \"登录要求.登录名失败.\ r \ n用户'NT的登录失败AUTHORITY \ LOCAL SERVICE'.} **
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
是我的数据库名称.
如何允许后台服务访问SQL Server数据库?
How do I allow my background service to access SQL Server database?
推荐答案
grant 用户 NT AUTHORITY \ LOCAL SERVICE
访问数据库
这篇关于如何允许窗口后台服务访问SQL Server数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!