Solved

Can't find PInvoke DLL 'sqlceme30.dll'

Posted on 2009-04-03
7
1,032 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now