views:

124

answers:

2

I have different instances of an [.NET 3.5] C# win forms application that run on different machines.

All instances use the same SQL 2005 db.

I need to send an alert and to refresh grids [contained in user controls] when another instance of the application changes smth in db.

Which is the best way ?

Thank you very much.

+1  A: 

Use an SqlDepedency. This can be done in WinForms as well as Asp.NET.

See this video: http://windowsclient.net/learn/video.aspx?v=27881

(pay attention to the technical note for prerequisites)

David Stratton
+2  A: 

AS David said one of the options is SqlDependency when SQL server itself sends notifications when data is changed. But you can also use WCF(or any other distributed solution) to keep communication between 2 instances and notify each other...

Incognito