Showing posts with label encountered. Show all posts
Showing posts with label encountered. Show all posts

Wednesday, March 28, 2012

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,

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

|||

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

Thanks Again ,

Matt

replication error

we are replicating from SQL 2000 to Oracle via linked server. and are
getting the following error "The process encountered invalid column
data in bcp file", the bcp file is too big to investigate it, any one
has any insight of this?
Did this ever work? By default SQL Server maps the SQL Server datatypes to
the Oracle datatypes, so it should be able to construct the table on Oracle
and bcp the data there. You might want to try it with a null filter to see
if the problem exists with the schema or the data.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"shunyen" <kate.s.chiang@.healthnet.com> wrote in message
news:1175209502.943214.313370@.d57g2000hsg.googlegr oups.com...
> we are replicating from SQL 2000 to Oracle via linked server. and are
> getting the following error "The process encountered invalid column
> data in bcp file", the bcp file is too big to investigate it, any one
> has any insight of this?
>
|||It worked before, the table got rebuilt and we have to recreate the
replication and this shows up. what do you meen to use a null
filter?
On Mar 30, 5:56 am, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
> Did this ever work? By default SQL Server maps the SQL Server datatypes to
> the Oracle datatypes, so it should be able to construct the table on Oracle
> and bcp the data there. You might want to try it with a null filter to see
> if the problem exists with the schema or the data.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTShttp://www.indexserverfaq.com
> "shunyen" <kate.s.chi...@.healthnet.com> wrote in message
> news:1175209502.943214.313370@.d57g2000hsg.googlegr oups.com...
>
>
> - Show quoted text -
|||A filter that looks like this
where 1=2
It always evaluates to false.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"shunyen" <kate.s.chiang@.healthnet.com> wrote in message
news:1175268021.364120.267330@.p77g2000hsh.googlegr oups.com...
> It worked before, the table got rebuilt and we have to recreate the
> replication and this shows up. what do you meen to use a null
> filter?
>
> On Mar 30, 5:56 am, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
>