K
Kai
I use SQLCE Help Book's code to test Replication, but I
always get the error:28557(The SQL Server CE database
cannot be used for replication. Delete and then re-create
the database.)
Error Code:80004005
Message:Run
Minor Err.:28557
Source:SQLCE
Err. PAr. :data sorce=\program\Nwind\ssce.sdf;
=========Source Code=========
Public Sub CreateReplDB()
Dim repl As SqlCeReplication = Nothing
If File.Exists("\Program Files\Nwind\ssce.sdf") Then
File.Delete("\Program Files\Nwind\ssce.sdf")
End If
Try
repl = New SqlCeReplication
repl.InternetUrl
= "http://IISServer/nwind_sqlce/sscesa20.dll"
repl.InternetLogin = [String].Empty
repl.InternetPassword = [String].Empty
repl.Publisher = "DBServer"
repl.PublisherDatabase = "Northwind"
repl.PublisherLogin = "sa"
repl.PublisherPassword = "123"
repl.Publication = "NWind"
''**********Error Line*****************************
repl.SubscriberConnectionString = "Data Source=\Program
Files\Nwind\ssce.sdf"
''**********Error Line*****************************
repl.Subscriber = "MyDevice"
repl.AddSubscription(AddOption.CreateDatabase)
repl.ExchangeType = ExchangeType.BiDirectional
repl.Synchronize()
MessageBox.Show("OK")
Catch ex As SqlCeException
MessageBox.Show(ex.message)
Finally
repl.Dispose()
End Try
End Sub
always get the error:28557(The SQL Server CE database
cannot be used for replication. Delete and then re-create
the database.)
Error Code:80004005
Message:Run
Minor Err.:28557
Source:SQLCE
Err. PAr. :data sorce=\program\Nwind\ssce.sdf;
=========Source Code=========
Public Sub CreateReplDB()
Dim repl As SqlCeReplication = Nothing
If File.Exists("\Program Files\Nwind\ssce.sdf") Then
File.Delete("\Program Files\Nwind\ssce.sdf")
End If
Try
repl = New SqlCeReplication
repl.InternetUrl
= "http://IISServer/nwind_sqlce/sscesa20.dll"
repl.InternetLogin = [String].Empty
repl.InternetPassword = [String].Empty
repl.Publisher = "DBServer"
repl.PublisherDatabase = "Northwind"
repl.PublisherLogin = "sa"
repl.PublisherPassword = "123"
repl.Publication = "NWind"
''**********Error Line*****************************
repl.SubscriberConnectionString = "Data Source=\Program
Files\Nwind\ssce.sdf"
''**********Error Line*****************************
repl.Subscriber = "MyDevice"
repl.AddSubscription(AddOption.CreateDatabase)
repl.ExchangeType = ExchangeType.BiDirectional
repl.Synchronize()
MessageBox.Show("OK")
Catch ex As SqlCeException
MessageBox.Show(ex.message)
Finally
repl.Dispose()
End Try
End Sub