ITPub博客

首页 > 应用开发 > > C#控制台程序添加到系统计划任务后数据库连接出错

C#控制台程序添加到系统计划任务后数据库连接出错

作者:ybbyic 时间:2019-09-18 10:35:43 0 删除 编辑

我这边有个控制台程序,添加到计划任务后 在如下图设置都要运行时,数据库连接就出错,提示连接不到服务器 !(A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server))

, 但选择账户登录时运行的话就不会有这问题 .

数据库为 2016 系统为window2013 服务器版

连接串是在程序里写死了, 请问这是什么原因造成的连接出错?

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1769/viewspace-3149175/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-15

  • 博文量
    88
  • 访问量
    1009