Link to home
Start Free TrialLog in
Avatar of Scott Pace
Scott PaceFlag for United States of America

asked on

Can't find PInvoke DLL 'sqlceme30.dll'

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

SOLUTION
Avatar of alexey_gusev
alexey_gusev
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Scott Pace

ASKER

Hi Alexey

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

Thanks
Scott
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
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
ok, then what is referenced in your app?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial