Solved

How to use MS Sql Server2000 Trigger event with C#.NET Window Application.

Posted on 2007-12-01
8
1,134 Views
Last Modified: 2013-12-16
I m developing a window application using C#.NET. I want to display the updated entry from MS SQL Server2000 database on the form using trigger in MS Sql Server2000. Can anyone tell me to catch the event that fired in SQL Server database (Trigger Event) when a new row insert. I want to use "Trigger reflection" in my C#.NET code so that i can display the updated database record without resending the request to database.
0
Comment
Question by:ddipro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 15

Accepted Solution

by:
spprivate earned 250 total points
ID: 20387641
You cannot catch a database trigger in the client.To show updated records you have to hit the db every time.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20387827
I have to agree with spprivate, you cannot do that.
0
 

Author Comment

by:ddipro
ID: 20393636
Is there any other way to do that...?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:ursangel
ID: 20394008
I hope,
The trigger will be fired either for an insert or update/delete of a record in the DB.
while doing that DB update if it is through a stored procedure. try to return back the rowset upadted as the result of the stored procedure. i think this will help you to some extend in re hitting the DB again.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20560724
TheLearnedOne:
unless you can come up with a suggestion how this could be implemented, you should revise your recommendation...
Last time I read the EE rules and guidelines, the <" No " can also be a correct answer> was still in there.
thanks for your time.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20592697
Forced accept.

Computer101
EE Admin
0
 

Expert Comment

by:Prutfugl
ID: 24096997
Have you considered SqlDependency or SqlCacheDependency?
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question