带有notifyicon的SQL Server监视服务 [英] Sql server monitor service with notifyicon

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

问题描述

我正在构建一个Windows服务,它将检查SQL表中是否有任何更改,如果它已导出这些更改并清空表。它会每15分钟左右完成一次。



我不知道我是如何构建的但是我在想

a用于运行查询的计时器和另一个连接到服务器的类,如果运行查询时出现问题


为此,我还要构建一个Winform,它将出现在Windows托盘图标和类型可以轻松访问配置和什么不。但是,我希望它在服务运行时显示不同的图标,当它不是时(几乎是实时和显示通知),并在记录所有这些时遇到任何类型的错误时显示通知。



我尝试了什么:



我是处理触发器,但我认为这是监视和记录更改的更好方法。

I am building a windows service that will check a SQL table for any changes and if it has will export those changes and empty the table. it will do this every 15 min or so.

I am not sure how I structure it yet but I am thinking
a timer to run the query and another class to connect to the server if it has a problem running the query

To go along with this, I am also building a Winform which will be present in the windows tray icon and sort of give easy access to configuration and what not. However, I want it to display a different icon when the service is running and when it isn't (almost real-time and show notification) and show a notification when it runs into any sort of error while logging all this.

What I have tried:

I am working on the triggers but I think this is a much better way to monitor and record changes.

推荐答案

为什么不使用SQL代理作业?这将运行服务器端,具有您需要的所有调度选项,它将减少网络流量。
Why not use a SQL Agent job? This will run server side, has all of the scheduling options you will need and it will reduce network traffic.


这篇关于带有notifyicon的SQL Server监视服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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