2

I have 2 applications both containing Datagridview connected to the same data-source.

When I insert data to the database via application1, the new data is instantly shown in the application1's Datagridview, I want the same new record to be shown in application2's Datagridview at the same time.

How do I achive this?

Ben
  • 2,433
  • 5
  • 39
  • 69
Dom
  • 404
  • 6
  • 12
  • Update app2's datagridview periodically. – Mathemats Apr 08 '15 at 06:02
  • or send a message whenever some data changes from one application to the other, and update the datagridview. read http://stackoverflow.com/questions/11358841/send-receive-message-to-from-two-running-application and also http://stackoverflow.com/questions/13742637/passing-information-between-applications-in-c-sharp – Zohar Peled Apr 08 '15 at 06:13
  • I have tried refreshing the datagridview periodically using a timer.It works but i want some other method to achieve my goal. – Dom Apr 08 '15 at 08:08

1 Answers1

0

You can do this using Service Broker via the SqlDependency object. It will fire an event in your application when the results of your query change.

Jon Tirjan
  • 3,556
  • 2
  • 16
  • 24