Windows服务访问SQL数据库 [英] Windows Service access to SQL database

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

问题描述

你好,



我的Windows服务无法访问本地SQL数据库,我不知道是什么问题,它在控制台应用程序中很好地连接相同的连接字符串。

我的connectionString是

Hello,

My Windows Service can't access to a local SQL database, I have no idea what is the problem, it connects well in console app with the same connection string.
My connectionString is

"Data Source=localhost;Initial Catalog=comp;Integrated Security=True";



(comp是我的数据库名称)

我的Windows服务是本地系统帐户。



感谢您的回答!



Zoli


("comp" is my database name)
My windows service is a Local System account.

Thanks for your answer!

Zoli

推荐答案

谢谢大家!你真的很有帮助! SQL身份验证连接字符串是解决方案。我必须学习为用户提供SQL中的数据库并添加读取权限。现在它完美运作了!



祝福,

Zoli
Thank you guys! You were really helpful! SQL authentication connection string was the solution. I had to learn giving users to databases in SQL and adding reading privileges. Now it work perfectly!

Best wishes,
Zoli


这篇关于Windows服务访问SQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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