如何允许窗口后台服务访问SQL Server数据库? [英] How to allow window background service to access SQL Server database?

查看:86
本文介绍了如何允许窗口后台服务访问SQL Server数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有访问我的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆