Click here to Skip to main content
15,936,709 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am new to WPF and data binding. I have a database table called Tag(id, name, value), I want to bind two application to this table, the first one has a (turn on/off) button which has binding to Tag.value, the second application has a lamp with two state (on and off) which again has binding to Tag.value. what is the best way and tools to do this task so when I click the turn on button on the first App it will directly change the lamp status at the second App. Thank in Advanced
Updated 7-Apr-14 5:25am
Sergey Alexandrovich Kryukov 7-Apr-14 14:41pm    
Not clear what is your concern. Sharing a database by few different applications (this way communicating through using some shared data) is just the commonplace.
bshanwar 7-Apr-14 14:52pm    
The problem that any change in the database from one application should directly appear in the second one, so should I check the database every 100 ms or there is a solution using data binding.
Sergey Alexandrovich Kryukov 7-Apr-14 15:03pm    
Yes, this is the pain: you have to poll a database in one application. By the way, can the two application be on different machines? If they are always on the same one (rare case, I understand), the problem is easy — mentioning that just in case.
bshanwar 7-Apr-14 15:06pm    
usually one of them should run on a server, other applications are client (web, mobile, or PC)
Sergey Alexandrovich Kryukov 7-Apr-14 15:09pm    
All right. I suggested one interesting schema for you. It's important feature is: it is safeguarded against difficult situations when you get another timer tick when your handler invoked in the previous tick is not yet complete... Please see Solution 1.

1 solution

Please see my comments to the question. This is one of the solutions: Polling Database with Timer[^].

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900