Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get the replication status using RMO in C#

0 views
Skip to first unread message

ezc

unread,
Aug 19, 2008, 11:31:23 AM8/19/08
to
Hi,

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

Paul Ibison

unread,
Aug 23, 2008, 1:17:25 PM8/23/08
to
You could run sp_replmonitorhelppublication:
http://msdn.microsoft.com/en-us/library/ms186304.aspx
HTH,
Paul Ibison (www.replicationanswers.com)


ezc

unread,
Aug 26, 2008, 9:32:56 AM8/26/08
to
Thanks for your answer but in this case we do not use the RMO API.

Emmanuel.

Paul Ibison a écrit :

Ciget

unread,
Oct 17, 2008, 11:28:03 AM10/17/08
to
Hi. Sorry , but how you take the access to RMO ??
I can`t use Microsoft.SqlServer.Management.Common.ServerConnection,
because i can`t see it...
Do i need to install additional dll ?
The final target, which i what to do - in windows form application i
want to monitor all replication, their status and date of last
successful replication/
Thank you
0 new messages