[英]How to run an event in C# when a Particular value is inserted in sql server table..?
I have a live application logging some values from a device @ the rate of one insertion per second.我有一个实时应用程序从设备记录一些值@每秒一次插入的速率。
Now my problem is i want to get notified in my UI when value inserted in table goes out of a range...现在我的问题是我想在表中插入的值超出范围时在我的 UI 中得到通知......
I don't Know how to implement this... Please help with which technique to use... is it trigger or CLR trigger or any other way....??我不知道如何实现这个......请帮助使用哪种技术......它是触发器还是CLR触发器或任何其他方式......??
You could probably use a timer to verify the newly inserted values, or, if you want to use a trigger, print some information and use SqlConnection.InfoMessage
event.您可能可以使用计时器来验证新插入的值,或者,如果您想使用触发器,请打印一些信息并使用SqlConnection.InfoMessage
事件。 In your event handler query the table for new values.在您的事件处理程序中查询表以获取新值。 Be aware that the second option would require a permanently opened connection which may be an issue.请注意,第二个选项需要永久打开的连接,这可能是一个问题。
You can try SQL server notification service.您可以尝试 SQL 服务器通知服务。 http://technet.microsoft.com/en-us/library/cc966501.aspx http://technet.microsoft.com/en-us/library/cc966501.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.