I would like to get the status of the replication using RMO interface.
By "replication status", I mean synchronization started or stopped; this
information is available in the replication monitor but I do not know
how to get it using the RMO interface?
I tried to get the synchronization status with the following peace of code :
Microsoft.SqlServer.Management.Common.ServerConnection
connPub = new
Microsoft.SqlServer.Management.Common.ServerConnection(_distributorName);
connPub.Connect();
Microsoft.SqlServer.Replication.ReplicationMonitor
replicationMonitor = new
Microsoft.SqlServer.Replication.ReplicationMonitor();
replicationMonitor.ConnectionContext = connPub;
bool replStatus = replicationMonitor.LoadProperties();
_log.ConsoleInfo(new object[] { "Replication status: " +
replicationMonitor.Status.ToString() });
This code returned for the status of ReplicationMonitor: "Running" even
when the synchronization is stopped ?
I tried also using an instance of
Microsoft.SqlServer.Replication.TransPublication but I got "Active" for
the status property when the synchronization is started or stopped?
Does anybody knows how to get exactly what we see in the replication
monitor?
Regards
Emmanuel
Emmanuel.
Paul Ibison a écrit :