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.
A bit more detailed description:
1. SQL Server Compact provider project contains the following reference to SQL CE assembly:
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 126.96.36.199 System.Data.SqlServerCe.dll in SQL CE 3.1 had version 188.8.131.52
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.
answered Feb 23 '10 at 21:23