SQLServerCE Replication

  • Thread starter Thread starter Atley
  • Start date Start date
A

Atley

Has anyone successfully connected a SQL Server database to a SQLServerCE? I
cannot seem to get the code part right... I have tried following the
examples on the site, but for some reason it doesn't quite work...

Any hints, examples of working databases i can try to imitate or to use to
find this one last piece of the puzzle?

As always any help will be greatly appreciated...

Atley
 
Yes, I can do sync from my PDA to my machine at my house.

What error(s) are you getting?

Can you hit the ISAPI.DLL on your web site from a computer and get a return
of "SQL Server CE Server Agent"?

A valid InternetURL with the ISAPI.DLL would be similiar to the below:
http://12.229.173.156\ssceweb2\sscesa20.dll.
 
Yes I get the message when I call to that URL on my local network... DO you
know of a valid VB.NET example for the Syncronization code? Does it do
replication and merge?

Atley
 
There is code samples in VS.NET 2003. If you type .SYNCHRONIZE you will get
code snippets on this.

Below is the code snippet from VS.NET 2003 help.

Example
[Visual Basic]
Dim repl As SqlCeReplication = Nothing

Try
' Set the Replication object
repl = New SqlCeReplication()
repl.InternetUrl =
"<http://www.northwindtraders.com/sqlce/sscesa20.dll>"
repl.InternetLogin = "MyLogin"
repl.InternetPassword = "<password>"
repl.Publisher = "MyPublisher"
repl.PublisherDatabase = "MyPublisher Database"
repl.PublisherLogin = "MyPublisher Login"
repl.PublisherPassword = "<password>"
repl.Publication = "MyPublication"
repl.Subscriber = "MySub"
repl.SubscriberConnectionString =
"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\ssce.sdf"

' Synchronize to the SQL Server 2000 to populate the Subscription
repl.Synchronize()

Catch e As SqlCeException
' Use your own error handling routine to show error information.
' ShowError.ShowErrors(e);

Finally
' Dispose of the Replication Object
repl.Dispose()
End Try
 
You could try the Northwind sample. On my computer it is located in:
E:\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\Samples\VB\Pocket PC\NorthwindCE

Obviously you need VS.NET 2003 installed for this sample but that is the
best MS environment to use anyhow.

Get that sample configured and working, disect it then try you own. There
are loads of confinguration settings that need to work before it will work.
Follow the instructions in the Readme file in the above directory and try
not to pull your hair out :-)

Gerard
 
Back
Top