index > SQL Server Everywhere Edition > Replication Error

Replication Error

Hi all,

I have encountered an error during replication. The following is my code;


Try

m_SQlEngine = New SqlServerCe.SqlCeEngine("Data Source =\Project_JobLogger.sdf")

m_SQlEngine.CreateDatabase()

Dim SqlCeConnection As New SqlServerCe.SqlCeConnection("Data Source =\Project_JobLogger.sdf")

m_SQLConnection.Open()

Dim Repl As SqlServerCe.SqlCeReplication

Repl = New SqlServerCe.SqlCeReplication

Repl.InternetUrl = http://Ganges/PJLogger/sqlcesa30.dll

Repl.Publisher = "Ganges"

Repl.PublisherDatabase = "Project_JobLogger"

Repl.Publication = "PJLPublisher"

Repl.Subscriber = System.Net.Dns.GetHostName

Repl.SubscriberConnectionString = m_SQLConnection.ConnectionString

Repl.HostName = System.Net.Dns.GetHostName

Repl.ExchangeType = ExchangeType.BiDirectional

Repl.Synchronize()

Catch ex As Exception

MessageBox.Show(ex.ToString())

m_SQLConnection.Close()

m_SQLConnection.Dispose()

End Try


The error just displays - System.Data.SqlServerCe.SqlCeException;SqlCeException

Can anyone state what is the problem please?

Thanks

Matt

Matt Falzon

Matt,

There is a lot more information hiding inside the SqlCeException that is being thrown that you'll need to troubleshoot this situation. Here is some code to unwrap the exception and get specifics.

Public Sub DisplaySQLCEErrors(ByVal ex As SqlCeException)

Dim errorCollection As SqlCeErrorCollection = ex.Errors
Dim bld As New StringBuilder()
Dim inner As Exception = ex.InnerException
Dim err As SqlCeError

For Each err In errorCollection

bld.Append(ControlChars.Lf + " Error Code: " + err.HResult.ToString())
bld.Append(ControlChars.Lf + " Message : " + err.Message)
bld.Append(ControlChars.Lf + " Minor Err.: " + err.NativeError.ToString())
bld.Append(ControlChars.Lf + " Source : " + err.Source)

Dim numPar As Integer
For Each numPar In err.NumericErrorParameters
If (numPar <> 0) Then
bld.Append(ControlChars.Lf + " Num. Par. : " + numPar.ToString())
End If
Next numPar
Dim errPar As String
For Each errPar In err.ErrorParameters
If (errPar <> String.Empty) Then
bld.Append(ControlChars.Lf + " Err. Par. : " + errPar)
End If
Next errPar

MessageBox.Show(bld.ToString(), "SQL Mobile Error")

Next err

End Sub

-Darren




.NET Compact Framework MVP
Darren Shaffer

Thanks a lot Darren, I found your piece of code very useful. It managed to specify the exact error

Thanks Again ,

Matt

Matt Falzon
reply 3

You can use google to search for other answers

 

More Articles

• Has anyone noticed a size difference between 2.0 and 3.0?
• SQL 2005 EXPRESS
• OutOfMemoryException with SQL Server Mobile
• SqlCeEngine Verify/Repair methods
• Datasource cannot connect in vs2005
• Migrating from 2005 to 2005 Mobile
• SQL Mobile Sync problems
• DataBase Connection for VS2005 C++ for Devices
• access SQL2005 MOBILE database in a VS2003 mobile app
• Error Saving Binary data to sql mobile
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Behavior difference between SQL Mobile P
• Storing bulk data from dataset to sql mo
• Export to SQL Server Everywhere Database
• Change database attributes with SQL?
• EDB - CeGetDBInformationByHandle
• My SQL application on Windows Mobile 5
• Default Mobile Database Application
• SQL Server Everywhere engine instancing
• .Net CF 2.0 Error , "Can't find PIn
• Cannot save English dates!
• SQL Server Mobile and isqlw20
• SQL 2005 EXPRESS
• How to set the default value for a datet
• Help Please...request to send data to th
• Upgrade SQLServer Mobile (.sdf) database

Hot Articles

• SQL 2005 EXPRESS
• Why EDB can't accept two properties with
• limited number of connections to SQLMobi
• RDA Pull method not creating tables/inse
• SQLMobile install help
• Unsupported HTTP function call was made
• ANN: Mobile Database Development Article
• nText database type
• SQL Server 2005 Everywhere Edition: Repl
• @@ROWCOUNT Support???
• Microsoft SQL Server Mobile Edition data
• Copy SQL Server 2005 DB to SQL Server Mo
• SQL Everywhere ConnectionString problems
• Setting up publication for merge replica
• fastest way to do large amounts of updates

Recommend Articles

• Merge replication via cradle using Activ
• parameterized query that counts the numb
• "SQL Everywhere" is a Sybase t
• RDA SQL MOBILE ERROR 28037 HResult = -2
• Regarding MergeReplication-Tutorial
• Relationship diagrams in SQL mobile 2k5
• Any Movement on the 4 gig limit???
• CREATE INDEX statement for SQL Mobile no
• Reference to Data.System.SqlServerCe in
• Datasource cannot connect in vs2005
• Question on synching through RDA using p
• Insert GUID into SQL Mobile Database tab
• Header Corruption Error
• Update sql server 2005 mobile edition
• Setting up Sql Mobile subscription