sqlitesystem.data.sqliteentrypointnotfoundexcept

"Cannot find entry point sqlite3_open_v2 in DLL sqlite3" when using System.Data.Sqlite


I am having problems connecting to a Sqlite database through System.Data.Sqlite. I was trying to use FluentNhibernate but that didn't work, so I went back to basics but got the same error: Cannot find entry point sqlite3_open_v2 in DLL sqlite3.

This is my (fairly simple I believe) code:

using (SQLiteConnection connection = new SQLiteConnection("Data Source=Stripper.s3db;Initial Catalog=main;"))
            {
                using (SQLiteCommand cmd = new SQLiteCommand("select * from album", connection))
            {
                cmd.Connection.Open();
                object t = cmd.ExecuteScalar();
                cmd.Connection.Close();
            }
        }

I have a reference to System.Data.SQLite so everything seems fine to me. The few explanations (you can barely call them tutorials) on the internet haven't helped me out.


Solution

  • It may be the version of Sqlite3 you are working against. The V2 methods are relatively new - introduced in v3.5