简体   繁体   中英

How To: Get Merge replication status via C#

The project I am working on uses Merger replication which works fine. Behind the scenes I have used a of service to deletes the clients side DB and get new records till a perticular mark and to check for the server connectivity.

The challenge I am currently facing is, when the service goes to starts mode after being stop, it automatically executes what its suppose to do. There is no way I can pause my service as I am not able to get the status of merge replication.

The option of steps I have/can take from the client side is

  1. Stop the exection of my function if the MergeReplication stauts is running.
  2. Force the Sync on Merge Replication from my C# code.

But, I do no know how to take the status of Merger Replication.

I did go through few links on StackOverFlow but nothing got me +ve results. I am stuck with this issue.

Another question is - What will happen after the 5GB mark of data is met in Sql Express when the new data is pushed to the Sql Express from the server. Fill it follow the FIFO method and delete the data which came in first automatically and starts fillup itself with the new data from the server that gets pushed?

Hope to get some +ve answers.

[EDIT: Title Corrected]

Please see How to: Synchronize a Push Subscription (RMO Programming) and How to: Synchronize a Pull Subscription (RMO Programming) for instructions on how to synchronize a Merge subscription programmatically using Replication Management Objects in C#.

This will give you the ability to synchronize subscription(s) on-demand and handle the Status event to inspect the Merge Agent progress.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM