I work on a Delphi program that uses a firebird database to store it’s data. It uses a home grown o.r.m. system. When two users look at the same data, for example in a data grid, and one changes something the other screen gets updated immediately. The way this works is that the objects in the one program store them self’s in the database. The database has a trigger that registers this change in a auxiliary changes log table. Writing to this changes log table triggers an event. The second program is listening to that event and knows from the entry in the changes log table what object was changed. It will reload that object and raise an event internally in that program. This event will cause all screens that are showing this object and all objects that base their behavior on this object to update. We would like to switch to .Net and maybe MS SQL. My question is: 1) How do I do this with MS SQL? 2) Is there a framework that supports this? So I won’t have to port this to .Net
A:
doesn't sound like this would be too difficult to implement in c#. try using the "observer pattern" with whatever custom modefications you'd like.
see_sharp_guy
2009-06-18 21:50:47
+1
A:
Since the .Net Framework 2.0 and MSSqlServer 2005 versions there is support for change notifications: using the SqlDependency class. You have an example in the codeproject.
Take also a look to some recommendations about using notifications in the msdn.
jmservera
2009-07-13 10:50:54