none
Migrating from SQLServerCE 3.5 to SQLServerCE 4.0 in VS 2012

    Question

  • Hello,

    I have a SQLServerCE 3.5 dB that I need to convert to SQLServerCE 4.0. I did the steps in http://technet.microsoft.com/en-us/library/bb896150.aspx, and got the following error:

    "Incompatible Database Version. If this was a compatible file, run repair. For other cases refer to documentation. [ Db version = 4000000,Requested version = 3505053,File name = C:\Users\Ralph\Documents\Visual Studio 2012\Projects\Bird Tracker - Without Setup\Bird Tracker\bin\Release\TestBirdDB.sdf ]"

    I opened the SQL Server Compact Toolbox For Runtime 3.5 and checked the version of C:\Users\Ralph\Documents\Visual Studio 2012\Projects\Bird Tracker - Without Setup\Bird Tracker\bin\Release\TestBirdDB.sdf, and it said 4.0.

    For TestBirdDB.sdf, I have Copy To Output Directory set to Always.

    Why am I getting this error?

    Thanks,

    Ralph


    • Edited by Ralph65 Sunday, September 29, 2013 2:46 PM
    Sunday, September 29, 2013 2:29 PM

Answers

  • Go to the references folder in your project(s), and remove it from there.

    Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com

    • Marked as answer by Ralph65 Wednesday, October 02, 2013 5:58 AM
    Tuesday, October 01, 2013 5:47 AM

All replies

  • Your database is already version 4, but you are still connecting with th 3.5 ADO.NET provider. Change your reference to  System.Data.SqlServerCe.dll to point to the version 4 file.

     

    Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com

    Sunday, September 29, 2013 3:19 PM
  • Hello,

    How do I do that? I tried going to Add References and searching for sqlserverce. When it came up, it said version 4.000. I selected it, and it said sqlserverce is already a reference. Is the one it is talking about ver 3.5? If so, how do I drop it?

    Thanks, Ralph

    Monday, September 30, 2013 4:33 AM
  • You already have a reference to the 3.5 version, remove that first.

    Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com

    Monday, September 30, 2013 6:34 AM
  • Hello,

    I understand that I have to remove the reference to the 3.5 version, but how do I do that? When I go to the Add Reference area, I cannot find anywhere that says that I have system.data.sqlserverce 3.5 installed.

    How do I remove the reference?

    Thanks,

    Ralph

    Monday, September 30, 2013 8:34 PM
  • Go to the references folder in your project(s), and remove it from there.

    Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com

    • Marked as answer by Ralph65 Wednesday, October 02, 2013 5:58 AM
    Tuesday, October 01, 2013 5:47 AM