views:

86

answers:

2

I am developing windows mobile application. I am using the SQLlite database. I am using the following code to connect to this database as follows

                SQLiteConnection cn = new SQLiteConnection();
                SQLiteDataReader SQLiteDR;
                cn.ConnectionString = @"Data Source=F:\CompNetDB.db3";
                cn.Open();
                SQLiteCommand cmd = new SQLiteCommand();
                cmd.CommandText = "select * from CustomerInfo";
                cmd.CommandType = CommandType.Text;
                cmd.Connection = cn;
                SQLiteDR = cmd.ExecuteReader();

In the above case I am getting the error "Cant find PInvike DLL SQLite.interop.dll". I have added the DLL System.Data.SQLLite from the \SQLite.NET\bin\compactframework this folder. This is the folder which is installed by default when I installed the SQLite. In the same folder there is one DLL file named SQLlite.Interop.66.DLL. When I try to add reference to this dll it is giving error that dll can not be added. Are the two dlls SQLlite.Interop.dll & System.Interop.066.dll same ? In the above code how to solve the error "Cant find PInvoke.SQLite.Interop.dll" Please can you tell whether there is mistake in my code or I am missing something in my application?

A: 

The interop DLL is a C DLL that has entry points for P/Invoke calls made in System.Data.SQLIte. You cannot add a reference to a native DLL, you have to copy it to the device separately. An easy way to do this is to add it to your project, set the build action to 'Content' and set Copy to Output Directory to 'Copy if Newer'. When you debug, Studio will then push that file down to the device for you.

ctacke
Can you please explain how to add DLL to project ?
Shailesh Jaiswal
Just use the usual "Add Existing Item" as you would for any file. You may have to change the filter to "All Files" to see it.
ctacke
Shailesh Jaiswal
I find out that dll in my solution explorer by using Show All Files but there is no such SQLlite.Interop.dll. Please help me
Shailesh Jaiswal
I downloaded SQLite a couple weeks ago and it was in my download.
ctacke
A: 

yah..i have the same problem from few days...bt its still not working doing all that stuffs..m really fade up now with this sqlite....can anyone describe solution for this..?

sameer