MVC2项目中如何对数据库记录进行日常维护?
Web 应用程序与数据库配合使用。应每天扫描一次数据库并向用户发送警报。
据我所知,必须创建额外的项目,该项目将安装在服务器上并使用相同的数据库。该项目创建的可执行文件必须安装在 Windows 调度程序中才能每天激活一次。
这看起来很复杂而且效率低下:启动额外的可执行文件并在同一个数据库上工作。
这是最好的方法吗?
A web application works with the database. Once a day, the database should be scanned and alerts should be sent to users.
From what I've seen out there, additional project has to be created which will be installed on the server and will work with the same database. Executable created by this project has to be installed in Windows scheduler to be activated once a day.
This seems complicated and inefficient: starting additional executable and working on the same database.
Is this the best possible way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那么您有不同的可能性:带有可执行文件的 Windows Scheduler 是一个不错的选择。另一种可能性是编写一个 Windows 服务,它将在后台执行任务。 Quartz.NET 是一个很好的框架,但 Windows Scheduler 可能足以满足您的场景。有一点是肯定的:最好在 ASP.NET 应用程序之外执行这些任务。
Well you have different possibilities: Windows Scheduler with an executable is a good one. Another possibility is to write a Windows Service which will execute the task in the background. Quartz.NET is a good framework for this but the Windows Scheduler might be sufficient for your scenario. One thing is for sure: it is be better to perform these tasks outside of your ASP.NET application.