RMO: Replication between SQL Server 2005 amd SQL Server 2005 Express
Hi!
On an existing MergePullSubscription (Subscriber: SQL Express) I call the SynchronizeWithJob() method. But each time, the following exception occures:
ExecutionFailureException:
The specified pull subscription is not configured with a synchronization agent job.
But how do I configure synchronization agent jobs in SQL Server 2005 Express?
[369 byte] By [
poorman] at [2008-1-28]
SynchronizeWithJob(), I think this is equivalent to executing sp_start_job to start the merge agent job. But since express has neither agent nor jobs, this will not work in the express case.
Instead try using SynchronizationAgent.Synchronize().
BOL should have more information and example. If not, the newest BOL should have proper information.
Wouldnt this work?
MergePullSubscription mergepubllsub = new MergePullSubscription("subdb",
pubserver, "pubdb", "publication", subconn)
mergepubllsub.Create();
MergeSynchronizationAgent syncAgent = mergepubllsub.SynchronizationAgent
syncAgent.Synchronize();
In addition to Microsoft.SqlServer.RMO.dll, you will need to reference Microsoft.SqlServer.Replication.dll. The MergeSynchronizationAgent is in this dll. Try that see if it helps. Let me know if that doesnt solve your problem. We can trouble shoot more.
Hi,
We have exactly a similar problem, but our reference are okay...
(MergeSynchronizationAgent throw an "Class not registered" exception)
Have you any idea ?
Thanks for your reply.
This is a run time error on the MergeSynchronizationAgent obtained with the SynchronizationAgent property.
As it is not a compile time error, I think the dlls are already registred. If not, what is the register process ?
We also try to use the asynchronous method SynchronizeWithJob but we are waiting for the 'status'... But it is never refreshed...
We are trying to go around this problem, with horrible solution...
If you are still alive, your help is welcome 
I had a similar problem, When you add a reference through Visual Studio and under the .NET tab select "Microsoft.SqlServer.Replication" it is actually adding the RMO assembly. The only way I found to get a hold on the MergeSynchronizationAgent object is to browse to "C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies" and add a reference to "Microsoft.SqlServer.Replication.dll" manually.
Hope this helps you out.