Accepted answer

Looks like you trying to use Linq2Sql with Sqlite which isn't supported by default (only SQL Server and SQL Server CE are supported), see this question for more details.

Have a look at using Entity Framework, which supports Sqlite, instead.


I just went through this and tried to implement. Got same error, then found that we can create database using SQLiteConnection as so:


And then using "db" you can do all database operation. Try it.


I have found this to work for me.

            string fileDB = "Data Source=:memory:";
            SQLiteConnection conn = new SQLiteConnection(fileDB);
            DataContext db = new DataContext(conn);

Using a file, credits to this guy for the file path.

string fileDB = "Data Source=" + Directory.GetParent(Environment.CurrentDirectory).Parent.Parent.FullName +

First check the company example of Linq2SQL here.

Related Query

More Query from same tag