Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I installed Sql Server 2008 r2 and later installed sql server compact sp2 for windows mobile. Its working fine. Now I'm trying to connect Sql Server CE through VS 2008 (New-project-Smart Device-Smart Device Project).
It is giving an error-
"Can't find PInvoke DLL 'sqlceme35.dll'"

I just don't know what to do and how to proceed.
I'm not having any smart device, just using USA Windows Mobile 5.0 Pocket PC R2 Emulator.

Some of them (searched on internet) are saying to install some CAB files on my smart device, which obviously i don't have one.

This is my code:

private void menuItem1_Click(object sender, EventArgs e)
{
    SqlCeConnection con;
    try
    {
        con = new SqlCeConnection("Data Source=C:\\Data_Base.sdf");
        con.Open();
        MessageBox.Show(con.State.ToString());
        textBox1.Text = "Hi dude...!";
    }
    catch (Exception ex)
    {
        textBox1.Text = ex.Message;
    }
    finally
    {
        con.Close();
        MessageBox.Show(con.State.ToString());
    }
}

Please suggest me how to get rid of this issue..

Also I'm unable to connect to SQL Server 2008 directly using Smart Device Applications...
Posted
Updated 16-Nov-10 1:37am
v2

1 solution

Have you installed the SQL Server CE to it?

Never used the Mobile SDK, so I'm taking a stab in the dark here, but this blog lists the primary reasons you would get that error, and the solution for them: Can’t find P/Invoke DLL sqlcemeNN.dll

Google seems to indicate that a lot of people's problems were with the cab files or not having installed server CE.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900