I'm getting the following exception when I connect to a new SQL Compact database file created using Visual Studio 2008:

System.Data.SqlServerCe.SqlCeException: You are trying to access an older version of a SQL Server Compact Edition database. If this is a SQL Server CE 1.0 or 2.0 database, run upgrade.exe. If this is a SQL Server Compact Edition 3.0 or later database, run Compact / Repair. [ Db version = 3505053,Requested version = 3004180,File name = C:\Dev\Model42.sdf ]

Looks to be saying that my database is version 3.5, but DataObjects.NET is trying to use 3.0. How do I go about getting DataObjects.NET to connect to a 3.5 database? I am using the version 4.2 release candidate.

This thread was imported from our support forum. The original discussion may contain more detailed answer. Original topic by commondream.

asked Feb 23 '10 at 14:44

Editor's gravatar image

Editor
46156156157

edited Oct 27 '10 at 09:17

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412


One Answer:

A bit more detailed description:

1. SQL Server Compact provider project contains the following reference to SQL CE assembly:

<Reference Include="System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>

This implies the highest available version of provider's DLL is used during build process.

2. DO v4.2 RC & RC2 installers are actually built on my machine, and I have 3 versions of VS.NET installed there: 2005, 2008 and 2010 beta.

So I have both SQL CE 3.1 and SQL CE 3.5 SP1 DLLs.

3. Assembly verson of SQL CE 3.1 is higher than version of SQL CE 3.5:

System.Data.SqlServerCe.dll in SQL CE 3.5 has version 3.5.1.0 System.Data.SqlServerCe.dll in SQL CE 3.1 had version 9.0.242.0

See e.g. https://jira.springsource.org/browse/SPRNET-1066

So that's why (in conjunction with 1 & 2) DataObjects.Net v4.2 RC actually references SQL CE 3.1 instead of SQL CE 3.5.

What's done:

  • Now we use <specificversion>True</specificversion> for SQL CE assembly reference.

  • RC2 installers will be rebuilt ~ in 2 hours.

answered Feb 23 '10 at 21:23

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

1

Accepted my own answer (it's correct).

(Oct 27 '10 at 09:17) Alex Yakunin Alex%20Yakunin's gravatar image

Ok, ok Alex, i believe you its corrent :-)

(Oct 27 '10 at 15:31) Peter Ĺ ulek Peter%20%C5%A0ulek's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA