Solved

Can't find PInvoke DLL 'sqlceme30.dll'

Posted on 2009-04-03
7
1,041 Views
Last Modified: 2013-12-27
Hello
I apologize for asking but in Windows Mobile I am using code to generate my database.

In my module I have the following declaration:
Public conn As New SqlCeConnection( _
    "Data Source=\My Documents\Warf.sdf")

This is used in a Sub below called:
Public Sub createWarfDB()

In my emulator but not on my iPaq i get the same annoying message:
Can't find PInvoke DLL 'sqlceme30.dll'

I have added the dll file to bin\debug and have attempted to load the dll file
 Dim ipfilename As String = "\bin\debug\sqlceme30.dll"
<DllImport("coredll", SetLastError:=True, CharSet:=CharSet.Auto)> _
    Public Function ShowSQLCEME30(ByVal ipfilename As IntPtr) As String

    End Function
I still get the same annoying message:
Can't find PInvoke DLL 'sqlceme30.dll'

Will someone be kind enough to help?
Thanks
Scott
Imports System.Data.SqlServerCe
Imports System.Data
Imports System.IO
Imports System.Runtime.InteropServices
 
Module modDatabase
Public ds As DataSet
 
Dim ipfilename As String = "\bin\debug\sqlceme30.dll"
    <DllImport("coredll", SetLastError:=True, CharSet:=CharSet.Auto)> _
    Public Function ShowSQLCEME30(ByVal ipfilename As IntPtr) As String
 
    End Function
    
    Public conn As New SqlCeConnection( _
    "Data Source=\My Documents\Warf.sdf")
 
Public Sub createWarfDB()
        'if database does not exist, create one
        Try
            If Not File.Exists( _
            "\My Documents\Warf.sdf") Then
                Dim sqlEngine As New SqlCeEngine( _
                "Data Source=" & _
                "\My Documents\Warf.sdf")
                sqlEngine.CreateDatabase()
        //More Code
    Catch ex As Exception
            ex.Message.ToString()
        End Try
 End Sub
End Module

Open in new window

0
Comment
Question by:drspmd
  • 4
  • 3
7 Comments
 
LVL 24

Assisted Solution

by:alexey_gusev
alexey_gusev earned 300 total points
ID: 24061297
have you installed Sql Server CE 3.0 on your emulator? depending on which WM version you're using, it may or may not be installed in the object store by default
0
 

Author Comment

by:drspmd
ID: 24062143
Hi Alexey

It looks like Sql Server CE 3.5 is installed. Would that be the problem? Is there a work around?

Thanks
Scott
0
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 24063446
I'd advise to check what dll you have under Windows folder and also click on Remove Programs in Settings on the emulator.

Why do you think it is installed (just checking possible problems ;) )?
If you've installed SQL Server CE 3.5 on the desktop, it doesn't mean it was installed on the emulator
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:drspmd
ID: 24063822
Hi Alexey

"Why do you think it is installed (just checking possible problems ;) )? "

I went to the emulator and noticed it had SqlServerCompact 3.5 Tools EN, Repl and Core under the Settings->Remove Programs. There was no mention of SQL Server CE 3.0.. Is that what you meant?

Thanks
Scott
0
 
LVL 24

Expert Comment

by:alexey_gusev
ID: 24064515
ok, then what is referenced in your app?
0
 

Accepted Solution

by:
drspmd earned 0 total points
ID: 24065825
Hi Alexey

I went back to My Projects->References and noticed the System.Data,SqlServerCe version was 3.0.0.3600.0. I highlighted this and changed the Specific Version from True to False and the version became 3.5.0.0. Now when I click Debug the app runs fine except for a A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll, but the app keeps working. I''m not sure if this is accurate but according to my research:
"it is because of a known issue in .NET CF where the System.SR.dll tries to load ENU resources from the satellite assembly that does not exist before falling back to the embedded resources. These exceptions will not have any effect on the runtime behavior of the application."

So by changing the the Specific Version from true to false it fixed it?

Scott
0
 
LVL 24

Assisted Solution

by:alexey_gusev
alexey_gusev earned 300 total points
ID: 24066298
yes, that exception is known issue, so I think all should be OK now
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let me explain this picture a little bit.  First, in case you haven't already guessed, you are looking at my 2 phones, an Android Samsung Galaxy S5 on the left and an iPhone 5 on the right.  They are on their respective cradles on my desk.  But, you…
I recently asked a question (http://www.experts-exchange.com/Programming/Smartphones/Android/Q_28684946.html) about Computer Inventory applications for Mobile Devices.  I was specifically interested in an app I could use on my android phone.  The be…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question