如何在csharp中创建触发器并在执行触发器时执行操作 [英] How do create trigger in csharp and do action when execute trigger

查看:151
本文介绍了如何在csharp中创建触发器并在执行触发器时执行操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望 c #windows应用程序 发送短信 当任何记录成功添加到SQL Server 2008中的特殊表时



i发送短信没有任何问题。 只希望短信发送的时间



我想要一些窗口表单,用于设置短信面板设置,联系号码和..现在我想要一些如下所示:



I want c# windows application for send sms when any record added successfully to special table in SQL Server 2008

i have not any problem with send SMS . only want the time that SMS should send .

I want have a some windows form for set SMS Panel Setting , Contact Numbers and ... Now i want some thing like below :

1-What is best method for doing this

2-Can i create trigger from windows application and detect it when execute (i know that i can create trigger in clr project but clr project don’t have a form for UI )

3-How do i detect when trigger accured ?





我是新手,请使用简单给我的指示



非常感谢



I AM Novice , Please use the simple Instructions for me

Thanks a lot

推荐答案

我想,你可以用SQLDependency Class [ ^ ],提供当数据库中的数据发生变化时接收通知的功能。



这是一个很好的例子:使用SqlDependency进行数据更改事件 [ ^ ]
I think, you can use SQLDependency Class[^], which provides functionality to receive notifications when the data in the database have changed.

Here is an excellent example: Using SqlDependency for data change events[^]


这篇关于如何在csharp中创建触发器并在执行触发器时执行操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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