如何在ASP.NET SQL Server中创建触发器 [英] How to create trigger in asp.net sql server
本文介绍了如何在ASP.NET SQL Server中创建触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在更新表时触发触发器. 如何在asp.net C#中创建触发器.
I want to fire trigger when tables are updated..
How to create trigger in asp.net C#..
推荐答案
Hello
ASP.Net中没有任何触发器创建.
但是您可以在SQL Server中通过" ASP.Net创建触发器.
很多方法.例如:
步骤1:您必须了解T-SQl语法和创建触发器的命令:请查看链接
中抢劫
注意:如果您不使用动态SQL命令,我真的很遗憾.在开发应用程序时(而非运行时),您可以在SQL Server中通过自身创建触发器.
动态创建触发器会复杂化您的程序,使用动态命令可能会带来安全风险(请查看此)
Hello
There is not any trigger creation "in" ASP.Net.
But you can create a trigger "through" your ASP.Net in the SQL-Server.
Many ways. For example:
Step 1: You must know the T-SQl syntax and command of creating trigger: Look at the link
Step 2: You must know aboutSQLCommand Class
in C#. Loot at the link
Note: I really think it would be a pity if you don''t use dynamic SQL Commands. You can create trigger in the SQL-Server through itself, when you are developing the application (not runtime).
Creating a trigger dynamically(!) will complicate your program and using dynamic commands maybe a security risk (Look at this)
查看msdn文档-
http://www.c-sharpcorner.com/UploadFile/pk_khuman/ManagedTrigersUsingCSharp02202007230729 /a> [ ^ ]
http://msdn.microsoft.com/en-us/library/938d9dz2%28v = vs.80%29.aspx [ ^ ]
Check out msdn documentation -
http://www.c-sharpcorner.com/UploadFile/pk_khuman/ManagedTrigersUsingCSharp02202007230729PM/ManagedTrigersUsingCSharp.aspx[^]
http://msdn.microsoft.com/en-us/library/938d9dz2%28v=vs.80%29.aspx[^]
这篇关于如何在ASP.NET SQL Server中创建触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文