Sunday, March 11, 2012

Bug in SQL Server 2005 CE ?

Hello,

I have some trouble with using Merge replication with SQL CE 3.0 (SQL Server 2005 CE).

I've develop a framework that make transition between SQL CE and Business Object (generic framework that use XML for mapping).

My trouble is that I can't upgrade SQL and so use merge replication or the reverse (replication and so upgrade)
When I did this, Visual Studio shows me that I lost connection with the PDA, and on the PDA, I see the error reporting that ask me if I want to send it to Microsoft... (the report contains only number of version and lot of hexadecimal code)
I have no Exception on Visual Studio that I can use for debug this trouble...

Whereas, when I launch this application, I did a merge replication, and stop the program. I relaunch it and make Upgrade And it's work.... (the reverse too)

I check in my code if I forgot to close connection on SQL Ce or else but I didn't find anything...

Anyone have already see this bug ? Or/And have you a pist for resolve it ?

For information:
I use :
SQL Server 2005 Compact Edition (Sql Ce 3.0)
SQL Server 2005 Standard or Entreprise SP1 on Windows Server 2003 (on Virtual Machine)
Compact Framework 2
Windows Mobile 5 and 6 on Emulator
To see if the trouble is cause by my framework, I try to take out the use of my framework and put a easy code.

But the result is the same... I can't make an update + replication.

Here my code :

First, this occur when I press the first button (update) :

Cursor.Current = Cursors.WaitCursor;
SqlCeConnection _conn = new SqlCeConnection(connexionstring);
_conn.Open();
SqlCeCommand _comm = _conn.CreateCommand();
string _req = "UPDATE Employee SET LastName = 'Damien' WHERE EmployeeID = '1'";
_comm.CommandText = _req;
_comm.CommandType = CommandType.Text;
_comm.ExecuteNonQuery();
_comm.Dispose();
_conn.Close();
_conn.Dispose();
Cursor.Current = Cursors.Default;

And now, the second button (Replicate) :

Cursor.Current = Cursors.WaitCursor;
SqlCeReplication repl = new SqlCeReplication();
repl.InternetUrl = @."http://192.168.0.1/Publication/sqlcesa30.dll";
repl.Publisher = @."w2003Mobile";
repl.PublisherDatabase = @."Prototype";
repl.PublisherSecurityMode = SecurityType.NTAuthentication;
repl.Publication = @."PubliProto";
repl.Subscriber = @."Subscription";
repl.SubscriberConnectionString = connexionstring;
try
{
repl.Synchronize(); //Bien dans un Try/Catch mais je n'obtiens pas d'exception..... juste le rapport d'erreur
}
catch (Exception ex)
{
throw new Exception("Erreur lors de la synchronisation", ex);
}
repl.Dispose();
Cursor.Current = Cursors.Default;

As when I test my framework, this code works when I try it separately (with shutdown of my application between two).
But when I try to Update and next Replicate, or reverse, it show me an error report...

I don't know why I've this probleme, so if someone can help me Smile
|||Nobody have some idea ?

Sad

I post 2 pictures that shows the error report :

Note the value of the API Cur Process is strange, isn't it ?

No comments:

Post a Comment