Search code examples
c#visual-studio-2012sql-server-cesql-server-ce-4sqlmetal

SQLMetal incompatible database error with SQL Server CE


I have created a simple SQL Server Compact database in my C# project. When I try to use SQLmetal with my database1.sdf file to create a code file, I am getting the following error message

Error : 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:\Documents\Visual Studio 2012\Projects\WpfApplication5\WpfApplication5\Database1.sdf ]

I have tried changing the project reference for System.data.SqlServerCe to 3.5 and 4.0 multiple times and each time i tried by creating a new sample project with new SQL Server Compact database.

Any help will be greatly appreciated.

Thanks.


Solution

  • Just install my free SQL Server Compact Toolbox extension, it can generate the Linq to Sql code for you! https://visualstudiogallery.msdn.microsoft.com/0e313dfd-be80-4afb-b5e9-6e74d369f7a1