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();
SQLiteCommand 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With