First, HeidiSQL is a management tool not a database.
Second, most data replication and synchronization engines will automatically check if the target machine is available before working.
Third, you should really be asking how to synchronize things, and one way is to use the Microsoft Sync Framework in c# if that is what you need :
http://en.wikipedia.org/wiki/Microsoft_Sync_Framework[
^]