Search code examples
visual-studiosql-server-cevisual-studio-2012sql-server-ce-3.5

How can I connect to a SQL Server Compact 3.5 file as a data source in Visual Studio 2012?


Visual Studio 2012 comes with SQL Server Compact 4.0. I have installed SQL Server Compact 3.5 from http://www.microsoft.com/en-GB/download/confirmation.aspx?id=5783 However I still only have the option of making a new data connection to a SQL Server Compact 4.0 file, whereas the files I need to get data from are SQL Server Compact 3.5 files.

enter image description here

Is it possible to connect to a SQL Server Compact 3.5 file as a data source in Visual Studio 2012? If so which settings or installs should I need?


Solution

  • Over in a thread I started on SQL Server Developer Center > SQL Server Forums > SQL Server Compact Ray Chen has posted an answer:

    Unfortunately, SQL Server CE 3.5 is not supported in VS 2012 indeed. You have to upgrade the SQL Server CE 3.5 database to 4.0 as Erik suggested [link added]. Also please take a look at this article: Visual Studio 2012 Compatibility. In the section of ‘These Assets Need Your Attention’, it says: One-way upgrade. You must upgrade these assets before you can open them in Visual Studio 2012. After you upgrade, you won’t be able to open them in previous versions. The following table lists the project types, file types, and technologies that you must upgrade. And SQL Server CE 3.5 is included in the table.

    I've posted a subsidiary question there to find out how, given that I cannot read in the file, I would convert it to SQL Server Compact 4.0.

    =========== EDIT ==========

    Ray Chen went on to post references to ErikEJ's blog post HOW TO: Upgrade a version 3.x database file to SQL Server Compact 4.0 and to the SqlCeEngine.Upgrade Method (String) library page.