SQL CE Replication Error

F

fookyuan

Hi,

I have problems replicating a database to the SQL CE and my codes are
like this


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click

Dim strDataSource = "My Documents\dbDataLogger.SDF"



Dim repl As SqlCeReplication = Nothing

repl = New SqlCeReplication
repl.Publisher = "MPG-001"
repl.PublisherLogin = "sa"
repl.PublisherPassword = ""
repl.Publication = "dbDataLogger"
repl.PublisherDatabase = "dbDataLogger2"

repl.InternetUrl = "http://mpg-001/sscePubs/sscesa20.dll"
repl.InternetLogin = ""
repl.InternetPassword = ""




repl.Subscriber = "Sub1"
repl.SubscriberConnectionString =
"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=" &
strDataSource

If System.IO.File.Exists(strDataSource) = False Then
repl.AddSubscription(AddOption.CreateDatabase)
Me.Refresh()
End If


repl.Synchronize() <---- ERROR HAPPENS HERE


End Sub



ERROR RECEIVED
==============
An unhandled exception of type
'System.Data.SqlServerCe.SqlCeException' occurred in
System.Data.SqlServerCe.dll

Additional information: SqlCeException



I've checked the merge agent on my SQL 2000 Svr and looks like it's
trying to merge the database with CE SQL but is unable to find the
subscriber. How do you create the subsribe on the handheld? Which is
anonymous ??
 
B

Brad Syputa - MS

Wrap a try catch block around the failure and get all of the errors. SQLCE
has many different sync errors and the specific errors should be able to
help you figure your issue, or get you close to a resolution.

--------------------
| From: (e-mail address removed) (fookyuan)
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Subject: SQL CE Replication Error
| Date: 25 Mar 2004 20:09:32 -0800
| Organization: http://groups.google.com
| Lines: 61
| Message-ID: <[email protected]>
| NNTP-Posting-Host: 219.94.124.114
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1080274172 12894 127.0.0.1 (26 Mar 2004
04:09:32 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: Fri, 26 Mar 2004 04:09:32 +0000 (UTC)
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!news-out.cwix.com!newsfeed.cwix.com!border1.nntp.ash.giganews.com!
nntp.giganews.com!news.glorb.com!postnews2.google.com!not-for-mail
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:49540
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi,
|
| I have problems replicating a database to the SQL CE and my codes are
| like this
|
|
| Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
| As System.EventArgs) Handles Button1.Click
|
| Dim strDataSource = "My Documents\dbDataLogger.SDF"
|
|
|
| Dim repl As SqlCeReplication = Nothing
|
| repl = New SqlCeReplication
| repl.Publisher = "MPG-001"
| repl.PublisherLogin = "sa"
| repl.PublisherPassword = ""
| repl.Publication = "dbDataLogger"
| repl.PublisherDatabase = "dbDataLogger2"
|
| repl.InternetUrl = "http://mpg-001/sscePubs/sscesa20.dll"
| repl.InternetLogin = ""
| repl.InternetPassword = ""
|
|
|
|
| repl.Subscriber = "Sub1"
| repl.SubscriberConnectionString =
| "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=" &
| strDataSource
|
| If System.IO.File.Exists(strDataSource) = False Then
| repl.AddSubscription(AddOption.CreateDatabase)
| Me.Refresh()
| End If
|
|
| repl.Synchronize() <---- ERROR HAPPENS HERE
|
|
| End Sub
|
|
|
| ERROR RECEIVED
| ==============
| An unhandled exception of type
| 'System.Data.SqlServerCe.SqlCeException' occurred in
| System.Data.SqlServerCe.dll
|
| Additional information: SqlCeException
|
|
|
| I've checked the merge agent on my SQL 2000 Svr and looks like it's
| trying to merge the database with CE SQL but is unable to find the
| subscriber. How do you create the subsribe on the handheld? Which is
| anonymous ??
|
 
F

fookyuan

Hi Brad,

I've append this Try...Catch block into my code as follow:

Try
repl.Synchronize() <------ ERROR HAPPENS HERE
PREVIOUSLY
Catch ex As SqlCeException
MsgBox(ex.Message.ToString)
End Try


The Error that I got is:
Initializing SQL Server Reconciler has faild. [,,,,,]

Any ideas what is causing this?? I believe it has something to do with
SQL security or perhaps IIS ??

Thanks for your advice...
 
B

Brad Syputa - MS

It is really hard to say. Enumerate all of the errors. You can also take a
look at a SqlCe security white paper from Microsoft.
http://www.microsoft.com/sql/ce is a place to look for good SqlCe
information
--------------------
| From: (e-mail address removed) (fookyuan)
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Subject: Re: SQL CE Replication Error
| Date: 26 Mar 2004 18:51:05 -0800
| Organization: http://groups.google.com
| Lines: 111
| Message-ID: <[email protected]>
| References: <[email protected]>
<[email protected]>
| NNTP-Posting-Host: 219.94.124.114
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1080355865 9754 127.0.0.1 (27 Mar 2004
02:51:05 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: Sat, 27 Mar 2004 02:51:05 +0000 (UTC)
| Path:
cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08
..phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news.glorb.com!postnews2.goo
gle.com!not-for-mail
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:49630
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi Brad,
|
| I've append this Try...Catch block into my code as follow:
|
| Try
| repl.Synchronize() <------ ERROR HAPPENS HERE
| PREVIOUSLY
| Catch ex As SqlCeException
| MsgBox(ex.Message.ToString)
| End Try
|
|
| The Error that I got is:
| Initializing SQL Server Reconciler has faild. [,,,,,]
|
| Any ideas what is causing this?? I believe it has something to do with
| SQL security or perhaps IIS ??
|
| Thanks for your advice...
|
|
| (e-mail address removed) ("Brad Syputa - MS") wrote in message
| > Wrap a try catch block around the failure and get all of the errors.
SQLCE
| > has many different sync errors and the specific errors should be able
to
| > help you figure your issue, or get you close to a resolution.
| >
| > --------------------
| > | From: (e-mail address removed) (fookyuan)
| > | Newsgroups: microsoft.public.dotnet.framework.compactframework
| > | Subject: SQL CE Replication Error
| > | Date: 25 Mar 2004 20:09:32 -0800
| > | Organization: http://groups.google.com
| > | Lines: 61
| > | Message-ID: <[email protected]>
| > | NNTP-Posting-Host: 219.94.124.114
| > | Content-Type: text/plain; charset=ISO-8859-1
| > | Content-Transfer-Encoding: 8bit
| > | X-Trace: posting.google.com 1080274172 12894 127.0.0.1 (26 Mar 2004
| > 04:09:32 GMT)
| > | X-Complaints-To: (e-mail address removed)
| > | NNTP-Posting-Date: Fri, 26 Mar 2004 04:09:32 +0000 (UTC)
| > | Path:
| >
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
| >
8.phx.gbl!news-out.cwix.com!newsfeed.cwix.com!border1.nntp.ash.giganews.com!
| > nntp.giganews.com!news.glorb.com!postnews2.google.com!not-for-mail
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.dotnet.framework.compactframework:49540
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
| > |
| > | Hi,
| > |
| > | I have problems replicating a database to the SQL CE and my codes are
| > | like this
| > |
| > |
| > | Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
| > | As System.EventArgs) Handles Button1.Click
| > |
| > | Dim strDataSource = "My Documents\dbDataLogger.SDF"
| > |
| > |
| > |
| > | Dim repl As SqlCeReplication = Nothing
| > |
| > | repl = New SqlCeReplication
| > | repl.Publisher = "MPG-001"
| > | repl.PublisherLogin = "sa"
| > | repl.PublisherPassword = ""
| > | repl.Publication = "dbDataLogger"
| > | repl.PublisherDatabase = "dbDataLogger2"
| > |
| > | repl.InternetUrl = "http://mpg-001/sscePubs/sscesa20.dll"
| > | repl.InternetLogin = ""
| > | repl.InternetPassword = ""
| > |
| > |
| > |
| > |
| > | repl.Subscriber = "Sub1"
| > | repl.SubscriberConnectionString =
| > | "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=" &
| > | strDataSource
| > |
| > | If System.IO.File.Exists(strDataSource) = False Then
| > | repl.AddSubscription(AddOption.CreateDatabase)
| > | Me.Refresh()
| > | End If
| > |
| > |
| > | repl.Synchronize() <---- ERROR HAPPENS HERE
| > |
| > |
| > | End Sub
| > |
| > |
| > |
| > | ERROR RECEIVED
| > | ==============
| > | An unhandled exception of type
| > | 'System.Data.SqlServerCe.SqlCeException' occurred in
| > | System.Data.SqlServerCe.dll
| > |
| > | Additional information: SqlCeException
| > |
| > |
| > |
| > | I've checked the merge agent on my SQL 2000 Svr and looks like it's
| > | trying to merge the database with CE SQL but is unable to find the
| > | subscriber. How do you create the subsribe on the handheld? Which is
| > | anonymous ??
| > |
|
 
F

fookyuan

Hi Brad,

My code seems to work now...manage to sync the entire table into the
handheld.
Thanks for your advice. But now I'm facing another problem.


After sync with the SQL Svr 2000, I insert a few data into the
database on the handheld. Then I try to sync the database again with
the SQL Svr 2000, my objective is to allow the SQL Svr 2000 to have
the data that I have inserted to the DB inside the handheld.

The sync is OK but after I check the DB in the SQL Svr 2000, there is
no data there and looks like my DB inside the handheld is also being
erased. Any idea ??

Thanks


It is really hard to say. Enumerate all of the errors. You can also take a
look at a SqlCe security white paper from Microsoft.
http://www.microsoft.com/sql/ce is a place to look for good SqlCe
information
--------------------
| From: (e-mail address removed) (fookyuan)
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Subject: Re: SQL CE Replication Error
| Date: 26 Mar 2004 18:51:05 -0800
| Organization: http://groups.google.com
| Lines: 111
| Message-ID: <[email protected]>
| References: <[email protected]>
<[email protected]>
| NNTP-Posting-Host: 219.94.124.114
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1080355865 9754 127.0.0.1 (27 Mar 2004
02:51:05 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: Sat, 27 Mar 2004 02:51:05 +0000 (UTC)
| Path:
cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08
.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news.glorb.com!postnews2.goo
gle.com!not-for-mail
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:49630
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi Brad,
|
| I've append this Try...Catch block into my code as follow:
|
| Try
| repl.Synchronize() <------ ERROR HAPPENS HERE
| PREVIOUSLY
| Catch ex As SqlCeException
| MsgBox(ex.Message.ToString)
| End Try
|
|
| The Error that I got is:
| Initializing SQL Server Reconciler has faild. [,,,,,]
|
| Any ideas what is causing this?? I believe it has something to do with
| SQL security or perhaps IIS ??
|
| Thanks for your advice...
|
|
| (e-mail address removed) ("Brad Syputa - MS") wrote in message
| > Wrap a try catch block around the failure and get all of the errors.
SQLCE
| > has many different sync errors and the specific errors should be able
to
| > help you figure your issue, or get you close to a resolution.
| >
| > --------------------
| > | From: (e-mail address removed) (fookyuan)
| > | Newsgroups: microsoft.public.dotnet.framework.compactframework
| > | Subject: SQL CE Replication Error
| > | Date: 25 Mar 2004 20:09:32 -0800
| > | Organization: http://groups.google.com
| > | Lines: 61
| > | Message-ID: <[email protected]>
| > | NNTP-Posting-Host: 219.94.124.114
| > | Content-Type: text/plain; charset=ISO-8859-1
| > | Content-Transfer-Encoding: 8bit
| > | X-Trace: posting.google.com 1080274172 12894 127.0.0.1 (26 Mar 2004
04:09:32 GMT)
| > | X-Complaints-To: (e-mail address removed)
| > | NNTP-Posting-Date: Fri, 26 Mar 2004 04:09:32 +0000 (UTC)
| > | Path:
| >
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
| >
8.phx.gbl!news-out.cwix.com!newsfeed.cwix.com!border1.nntp.ash.giganews.com!
| > nntp.giganews.com!news.glorb.com!postnews2.google.com!not-for-mail
| > | Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:49540
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
| > |
| > | Hi,
| > |
| > | I have problems replicating a database to the SQL CE and my codes are
| > | like this
| > |
| > |
| > | Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
| > | As System.EventArgs) Handles Button1.Click
| > |
| > | Dim strDataSource = "My Documents\dbDataLogger.SDF"
| > |
| > |
| > |
| > | Dim repl As SqlCeReplication = Nothing
| > |
| > | repl = New SqlCeReplication
| > | repl.Publisher = "MPG-001"
| > | repl.PublisherLogin = "sa"
| > | repl.PublisherPassword = ""
| > | repl.Publication = "dbDataLogger"
| > | repl.PublisherDatabase = "dbDataLogger2"
| > |
| > | repl.InternetUrl = "http://mpg-001/sscePubs/sscesa20.dll"
| > | repl.InternetLogin = ""
| > | repl.InternetPassword = ""
| > |
| > |
| > |
| > |
| > | repl.Subscriber = "Sub1"
| > | repl.SubscriberConnectionString =
| > | "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=" &
| > | strDataSource
| > |
| > | If System.IO.File.Exists(strDataSource) = False Then
| > | repl.AddSubscription(AddOption.CreateDatabase)
| > | Me.Refresh()
| > | End If
| > |
| > |
| > | repl.Synchronize() <---- ERROR HAPPENS HERE
| > |
| > |
| > | End Sub
| > |
| > |
| > |
| > | ERROR RECEIVED
| > | ==============
| > | An unhandled exception of type
| > | 'System.Data.SqlServerCe.SqlCeException' occurred in
| > | System.Data.SqlServerCe.dll
| > |
| > | Additional information: SqlCeException
| > |
| > |
| > |
| > | I've checked the merge agent on my SQL 2000 Svr and looks like it's
| > | trying to merge the database with CE SQL but is unable to find the
| > | subscriber. How do you create the subsribe on the handheld? Which is
| > | anonymous ??
| > |
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top