[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Can't find PInvoke DLL 'sqlceme30.dll'

Posted on 2009-04-03
7
Medium Priority
?
1,071 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 1200 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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 

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 1200 total points
ID: 24066298
yes, that exception is known issue, so I think all should be OK now
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
If you have a smartphone, I'm sure you've noticed that web applications are changing. Yet, are you aware of how these changes are going to impact your organization or company?
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…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

612 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