Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

SqlCeReplication Problem

JamesJames Posts: 217Member
I'm So frustrated!

I want to sync to a publication using SQL Server CE 2.0.

I've set up the publication to Northwind on my own computer, installed the agent there, set up the Virtual Directory with NTFS permissions etc. But when I try to execute the synch command I get an inner exception of: Referenced object has a value of 'Nothing'

Here's my code: [code]

oRepl = New SqlCeReplication
oRepl.Publisher = "JKENNEDY"
oRepl.PublisherDatabase = "Northwind"
oRepl.Publication = "CMMMerge"
oRepl.SubscriberConnectionString = "Data Source=My DocumentsNorthwind.sdf;"
oRepl.Subscriber = "CEDevice"
oRepl.InternetUrl = "http://localhost/SQLCE/sscesa20.dll"
oRepl.InternetLogin = "jkennedy"
oRepl.InternetPassword = "jkennedy"
oRepl.ExchangeType = ExchangeType.BiDirectional

Try
If Not File.Exists("My DocumentsNorthwind.sdf") Then
oRepl.AddSubscription(AddOption.CreateDatabase)
End If

oRepl.Synchronize()
Catch ex As Exception
Throw ex
Finally
oRepl.Dispose()
End Try

[/code]




It steps through the code just fine until the oRepl.Synchronize(). That's when I get the error.

Thanks for any help,

James

Sign In or Register to comment.