0

Currently, I have a requirement to downgrade my database from sqlce4.0 to sqlce3.5 for our application to consumer, I found a post Downgrade SQL CE from 4 to 3.5? and it basically meets my requirement except that both solutions need user's interference. Ideally, I want to code a tiny tool to archieve this goal to make this conversion AUTOMATICALLY(i.e. without any interference to the user). So my idea is: 1. Since I know the schema of this DB, so I create a sqlce3.5 empty DB first.
2. Then open the old sqlce4.0 DB and new sqlce3.5 DB at the same time, and then query the records table by table from the sqlce4.0 DB and insert them into the new sqlce3.5 DB. It sounds nice, but when I try it with a C# project, it seems that it can only add one sqlce assebmly reference(either V3.5 or V4.0). I know it make sense to advoid namespace pollution. But how can I workaround it? 3. Or If I have to export the data to a sql file and then import it to sqlce3.5 DB? If thire some console utility that supports import the sql data to sqlce3.5 DB. The reason I ask for the console utility is just because I want to import it automatically without inerference to the user as I mentioned above.

 Thanks in advace for your answer.
Community
  • 1
  • 1
badguy
  • 113
  • 1
  • 2
  • 6

1 Answers1

0

You can use my scripting API (exportsqlce.codplex.com) to export the entire database from code (or use my exportsqlce40.exe command line tool), then use sqlcecmd.exe to create a 3.5 database and run the script (this can also be done via my scripting API).

But in your app, if you directly reference 4.0 (System.data.sqlserverce.dll) you must of course update your app to reference the older version.

ErikEJ
  • 40,951
  • 5
  • 75
  • 115