Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to fire trigger when tables are updated..
How to create trigger in asp.net C#..
Posted

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 about SQLCommand 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)
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900