0

I attempt to delete a number of rows from a table in a SQL Server CE 3.5 database and I get a SqlCeException:

An internal error occurred. [ ID = 3649 ]

I've read that it means that the database is in a corrupted state and must be repaired although there is little information about the specific error.

I use the SqlCeEngine.Verify() and it returns true. According to MSDN

Returns True if the checksums match and there is no database corruption; otherwise, false.

I also use the SqlCeEngine.Repair(null, RepairOption.RecoverCorruptedRows); and then attempt to delete the rows again and the command is executed without any errors and rows are deleted.

I'm confused is it or not the db corrupted? I think it is (but the verify returns true). If it is corrupted how it became corrupted? I create a new connection for every database access and I don't share the same SqlCeConnection objects between threads (or any other SQL Server CE related objects) The database is deployed on a mobile device.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Stavros Zotalis
  • 718
  • 4
  • 24
  • 1
    First make sure you are running the latest SQL Compact engine build on the device: http://erikej.blogspot.dk/2010/08/sql-server-compact-35-sp2-downloadable.html – ErikEJ Nov 11 '15 at 16:51
  • @ErikEJ I updated the device to the SP2 and then SqlCeEngine.Verify(VerifyOption.Enhanced) returned false. After reading your blogpost and http://erikej.blogspot.gr/2010/10/how-to-detect-sql-server-compact.html I installed the cummulative update 7 and reinstalled sqlce cabs too, but ServerVersion returns `"3.5.8080.0"` is it correct? – Stavros Zotalis Nov 12 '15 at 10:40

0 Answers0