Updating Client on Database Changes

  • Thread starter Thread starter Dino Buljubasic
  • Start date Start date
D

Dino Buljubasic

Hi,
How can I update my client imediatelly if database info has changed?

Example 1.
Clinet A (win forms app in C#) has displayed on its form data
retrieved from database (SQL Server).
Client B adds new info or edits existing info of data displayed on
Client A. How can this change be immediatelly updated on Client A
form?

Example 2.
How to stop client B from deleting data that is already displayed on
client A win form?

Any help will be appreciated.

_dino_
 
If you're using the 2.0 framework, I think the SqlDependency is what you're
looking for.
 
Ah, I doubt it. The overhead involved with the SqlDependency technology
might be to onerous for many general-purpose applications. It can't really
serve as a way to manage concurrency without a thorough understanding of the
mechanism. Consider that when you setup a SqlDependency a trigger is added
to the target table that examines each INSERT, UPDATE and DELETE to see if
the query impacts the selected rows being monitored. This has to be executed
on each action operation and can bring a server to its knees if not
carefully implemented.
In this case I would suggest research on concurrency techniques. These are
not new questions and there are a wealth of workable solutions.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Bill:

I agree with everything you said. I myself have lectured about how it's not
a magic bullet and should have been more careful in explaining the downside
here. Thanks for doing what I should have ;-)
 
Back
Top