Solved

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

Posted on 2007-12-01
8
1,129 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

730 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