SqlCeReplication Problem - Programmers Heaven

Howdy, Stranger!

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

Categories

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.