SQLite.Interop.DLL How to use non managed DLL
I would like to use System.Data.SQLite with an wpf application. So I dowloaded the files here and add the reference to System.Data.SQLite downloaded.
Then I write the code
SQLiteConnection connex = new SQLiteConnection(@"Data Source=C:\Users\Toto\Desktop\Test.sqlite;");
connex.Open();
DataTable dt = new DataTable();
SQLite开发者_如何学GoCommand command = connex.CreateCommand();
command.CommandText = "SELECT * FROM TEST";
SQLiteDataAdapter da = new SQLiteDataAdapter();
da.SelectCommand = command;
da.Fill(dt);
connex.Close();
But It doesn't work.. When I try to open the connexion, it says that it is impossible to find the SQLite.Interop.dll.. No problem I have this one but impossible to add reference to it because it is an unmanaged DLL.
So, if someone is used to use SQLite and ADO.NET I'm looking for advices..
Thanks a lot
You just need to copy the unmanaged DLL to the same folder as your EXE.
精彩评论