views:

398

answers:

5

Hello.
I have developed a win mobile (v5.0) application and I use ONLY 1 database SQLITE with these references:

  • System.Data.SQLite.dll (assembly version & product version : 1.0.65.0);
  • SQLite.Interop.065.DLL (product version : 1.0 and is a c++ lib for first dll ).

After 5 weeks of using of this application, I get today a weird exception and I dont understand what it is? Exception is:

MissingMethodException  
Can`t find PInvoke DLL 'sqlceme30.dll '

at

System.Data.SqlServerCe.SqlCeCommand.ReleaseNativeInterfaces()
at
System.Data.SqlServerCe.SqlCeCommand.Dispose(Boolean disposing)
......

What`s wrong? Anyone know about this to explain me please?

By the way : until now I delevoped 3-4 applications (1 year ago )using these references and everything worked fine.

+1  A: 

It's possible either the 'sqlceme30.dll' is missing or maybe you're out of Virtual Memory and the DLL can't be loaded. Try on an emulator and/or closing some apps first.

statichippo
I use only sqlite.dll in my application and I haven`t any references for sqlceme30.dll. I don`t understand this, why i have exception about sqlceme30.dll If all my references are sqlite ?No one sql connection for sqlce.dll ? only for sqlite.
out of memory seems like the most common (and obscure) problem
knittl
A: 

Have a look through your code to see if SqlCeCommand is used anywhere. It shouldn't be as you are using SqLite with the correct DLLs.

If you can't find any references to SqlCeCommand in your code, have a look at any external libraries you might have added recently which may rely on SQL CE/Mobile.

tomlog
I use only this instance :" public SQLiteConnection Connection"nothing about SqlCeCommand.I find "SqlCeCommand" in entire solution and no results.
Can you possibly post the full trace of the exception in your question?
tomlog
A: 

Have any applications been installed recently that may have overwritten this dll with a different (perhaps older) version that does not have that method name (or the same method with a different signature)?

Run the VS Command Prompt and go to the directory where that dll is located and run dumpbin /exports sqlceme30.dll. This will list all the exported function names and see if the one you are trying to call is in the list.

Nick
A: 

This dll is needed for SQL CE. Your problem will go away if you deploy the Sql CE dlls along with your application, or install SQL CE 3.0 (the CAB file) on your device.

BUT, it's strange that you get this error and you do not use Sql CE, but SQLite. Do you have a reference to System.Data.SqlServerCe in your project? If that is the case, can you remove it and see if your app still compiles and runs?

A: 

This exceptions seems to indicate a problem with low memory, there's a blog post which explains it very well: http://www.tomergabel.com/NETCompactFrameworkPInvokeAndMissingMethodException.aspx

you can try increasing memory on your device, or invoking a dummy call upon startup, so the dll gets loaded.

knittl