This project is read-only.

Can't open SQL CE 4.0 on Win7 64 bit (CE 3.5 previously worked fine)

Sep 18, 2013 at 6:49 PM
I had been using the CEQuery for CE 3.5 for a couple of years and it worked fine.
I uninstalled the CEQuery for CE 3.5 and installed CEQuery for CE 4.0 and now it fails to open any CE 4.0 databases.
(I tried copying the dll's as noted in but it still fails.)
Any ideas?

The error from the unhandled exception dialog:
System.Data.SqlServerCe.SqlCeException: Possible file version mismatch detected between ADO.NET Provider and native binaries of SQL Server Compact which could result in an incorrect functionality. This could be due to the presence of multiple instances of SQL Server Compact of different versions or due to wrong binaries with same name as SQL Server Compact binaries. Please install SQL Server Compact binaries of matching version.
   at System.Data.SqlServerCe.NativeMethods.IsValidBinary(String filename)
   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinariesFromPrivateFolder(String privateInstall)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
   at System.Data.SqlServerCe.SqlCeConnection..ctor()
   at System.Data.SqlServerCe.SqlCeConnection..ctor(String connectionString)
   at CEQuery.OpenDB.btnOK_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
    Assembly Version:
    Win32 Version: 2.0.50727.4984 (win7RTMGDR.050727-4900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
    Assembly Version:
    Win32 Version:
    CodeBase: file:///C:/Program%20Files%20(x86)/Mayukh's%20Lab/CEQuery/CEQuery.exe
    Assembly Version:
    Win32 Version: 2.0.50727.4986 (win7RTMGDR.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/
    Assembly Version:
    Win32 Version: 2.0.50727.4985 (win7RTMGDR.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/
    Assembly Version:
    Win32 Version: 2.0.50727.4985 (win7RTMGDR.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/
    Assembly Version:
    Win32 Version: 4.0.8482.1
    CodeBase: file:///C:/Program%20Files%20(x86)/Mayukh's%20Lab/CEQuery/System.Data.SqlServerCe.DLL
    Assembly Version:
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_64/System.Data/
    Assembly Version:
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_64/System.Transactions/
    Assembly Version:
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/
Oct 27, 2013 at 9:42 PM
Hii Matt,
I am sorry to respond you late. Can you please uninstall all the version of SQL Server CE version from your machine, restart the system and then try to follow the method mentioned in

Let me know if this resolves the issue.

Oct 28, 2013 at 6:06 PM
No luck.
Still fails the same way.
Nov 30, 2013 at 12:47 PM
Edited Nov 30, 2013 at 12:48 PM
Hi All,
the link Ray mentioned was an old thread of mine - where Ray's solution worked fine! NOW:

I'm also having the same problem again in my W8 environment; BUT the procedure which worked in W7 doesn't obviously apply to W8 CE 4.0!

Ray, I sent this issue to you through another codeplex channel, sorry
BUT thanks for your time and any hints
ed k