none
Incompatible Database Version. If this was a compatible file, run repair. For other cases refer to documentation. [ Db version = 4000000,Requested version = 3505053

    Question

  • I am trying to get SSCE 4.0 working with VS2010, with a C# desktop windows application. The SSCE 4 database was created in VS2010 and contains a single table with 4 rows. Both VS Server Explorer and SQL Server Compact Toolbox can read the table.

    Not the same story with the code below, which fails with the exception: ‘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\Dave\Documents\Visual Studio 2010\Projects\SDF1\SDF1\App_Data\SDF1.sdf ]’

    Source of exception: SSCE ADO.NET Data Provider

    I can’t see what is going wrong here?

    Here are some details about the installation and test program I’m using:

    Windows 7 x64.

    Microsoft Visual Studio 2010, Version 10.0.40219.1 SP1Rel

    Microsoft .NET Framework, Version 4.0.30319 SP1Rel

    Web Platform Installer – installed database products:

    • SQL Server Compact Latest
    • SQL Server Compact 4.0 SP1
    • SQL Server Compact Latest Scripting Tools
    • SQL Server Compact 4.0 SP1 Scripting Tools
    • Visual Studio 2010 SP1 Tools for SQL Server Compact 4.0

    Also installed:

    • SQL Server Compact Toolbox   3.3

    Project: SDF1 – Windows Application

    Used SQL Server Compact Toolbox option: ‘add LINQ to SQL DataContext to project’

    namespace SDF1

    {

           public partial class Form1 : Form

           {

                  private static string conn = @"Data Source = 'C:\Users\Dave\Documents\Visual Studio 2010\Projects\SDF1\SDF1\App_Data\SDF1.sdf';";

                  private SDF1Context m_db = new SDF1Context(conn);

                  public Form1()

                  {

                         InitializeComponent();

                         var q = from r in m_db.Countries select r;

                         string s = q.First().Country;

                  }

           }

    }

    Sunday, June 23, 2013 11:31 AM

Answers