简体   繁体   English

Windows Task Scheduler和sdf数据库

[英]Windows Task Scheduler and sdf Database

I have a relatively simple C# application which grabs some data from a website and writes it into an sdf database file. 我有一个相对简单的C#应用​​程序,该应用程序从网站上获取一些数据并将其写入sdf数据库文件中。

The application itself works just fine - however if i run the application as a scheduled task with the windows task scheduler it does not add anything to the database (it still shows up as running in the task manager, as intended). 该应用程序本身运行良好-但是,如果我使用Windows任务计划程序将其作为计划任务运行,它不会向数据库添加任何内容(它仍显示为按预期在任务管理器中运行)。

So just to clarify it again: Manually starting the exe works just fine (click or command window), but starting it as a task (no matter if scheduled or manually) it runs but does not add anything to the database. 因此,只需再次说明一下:手动启动exe即可正常工作(单击或命令窗口),但作为任务启动(无论是计划还是手动)启动,它都会运行,但不会向数据库添加任何内容。

What differences are there between starting an exe manually compared to a task which has a "start program" action? 与具有“启动程序”操作的任务相比,手动启动exe有什么区别?

Sadly this is not really the perfect answer for the question, but I have now got it working by using an SQL Server (MS-SQL 2014 Express). 遗憾的是,这并不是该问题的完美答案,但是我现在通过使用SQL Server(MS-SQL 2014 Express)使其正常工作。

Apparently .sdf files and the windows task scheduler aren't best friends. 显然.sdf文件和Windows Task Scheduler不是最好的朋友。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM