Solved

Can't find PInvoke DLL 'sqlceme30.dll'

Posted on 2009-04-03
7
1,045 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Suggested Courses

751 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