C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Triggers


Posted Date: 05 Nov 2009      Posted By: Preet      Member Level: Gold     Points: 1   Responses: 5



How do we add Triggers in SQL while working in .net framework.




Responses

Author: Neetu    05 Nov 2009Member Level: DiamondRating: 1 out of 5     Points: 1

Try this type of code dear.

da1 = New OleDbDataAdapter("select * from emp", con)
da2 = New OleDbDataAdapter("select * from dept", con)
da1.Fill(data, "emp")
da2.Fill(data, "dept")
Dim dr As New DataRelation("demp", data.Tables("dept").Columns("deptno"), data.Tables("emp").Columns("deptno"))
data.Relations.Add(dr)

regards
Neetu



Author: Anuraj    05 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

I think you can write the CREATE TRIGGER statement and call the executeNonQuery method to execute it against the DB.

Thanks
Anuraj
THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS.
BEWARE OF BUGS IN THE ABOVE CODE; I HAVE ONLY PROVED IT CORRECT, NOT TRIED IT.
dotnetthoghts



Author: thiyagarajan    05 Nov 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

create a trigger statement for the table u want and call the execute nonquery method.


Author: Preet    06 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Thanks Neetu for your reply, the codes works well for me now.

regards



Author: Neetu    09 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Its my pleasure.

regards
Neetu



Post Reply
You must Sign In to post a response.
Next : Silverlight
Previous : Reg : web service
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use