943,696 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 6802
  • ASP.NET RSS
Feb 6th, 2008
1

trigger example???

Expand Post »
Hi

i m working with ASP.Net, C#

i need to have an example of trigger

how to call it from C#, and how to execute???
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
u4umang2001 is offline Offline
28 posts
since Nov 2007
Feb 6th, 2008
0

Re: trigger example???

what kind of trigger do you mean?
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Feb 6th, 2008
0

Re: trigger example???

sql trigger
Reputation Points: 10
Solved Threads: 0
Light Poster
u4umang2001 is offline Offline
28 posts
since Nov 2007
Feb 6th, 2008
0

Re: trigger example???

you dont call a trigger from asp.net, sql trigger is constructed in sql server and it listens for the changes in the specified table(updates, deletes, inserts) .If specified table is modified, then trigger do some changes according to what it is told to.
take this for an example : you have related tables, when the parent table row is deleted you want to delete all the childrows of that parent row, then you specify a trigger for the parent table and tell it to delete all the records in the corresponding child table when a row deleted from the parent table.
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Feb 6th, 2008
0

Re: trigger example???

Read up on Primary keys and Foreign keys. This is how you relate the tables together with a trigger to delete all childrows or update all childrows when the parent row is modified or deleted. This is all done on the server, so if you wish for an explanation of triggers, please visit the MS SQL portion of this site at: http://www.daniweb.com/forums/forum127.html
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Feb 14th, 2008
0

Re: trigger example???

Hi

i m working with ASP.Net, C#

i need to have an example of trigger

how to call it from C#, and how to execute???
Hi u4umang2001,
Just check this link, which contains good article. Hope this will help you.

http://www.c-sharpcorner.com/UploadF...ingCSharp.aspx

Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
Last edited by Ezzaral; Jun 25th, 2011 at 11:39 am. Reason: Snipped sig link.
Reputation Points: 10
Solved Threads: 4
Light Poster
dilipv is offline Offline
30 posts
since Feb 2008
Jun 19th, 2011
0

trigger

hi i want example for trigger
Reputation Points: 10
Solved Threads: 0
Newbie Poster
naveen.k is offline Offline
1 posts
since Jun 2011
Jun 25th, 2011
0
Re: trigger example???
{CREATE | RECREATE | CREATE OR ALTER} TRIGGER name FOR {TABLE name | VIEW name}
[ACTIVE | INACTIVE]
{BEFORE | AFTER}
{INSERT [OR UPDATE] [OR DELETE] | UPDATE [OR INSERT] [OR DELETE] | DELETE [OR UPDATE] [OR INSERT] }
[POSITION n] AS
BEGIN
.....
END
This is one of the example of firing the trigger
Reputation Points: 13
Solved Threads: 4
Light Poster
shiva07 is offline Offline
37 posts
since Jun 2011
Jun 25th, 2011
0
Re: trigger example???
Reputation Points: 2
Solved Threads: 8
Junior Poster in Training
matricol is offline Offline
98 posts
since Jun 2011

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Newbie Try-Catch question
Next Thread in ASP.NET Forum Timeline: GridView Update....





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC