What is a mixed mode assembly?

http://msdn.microsoft.com/en-us/library/x0w2664k.aspx 1) Allways check msdn first. Mixed mode means that the assembly can run managed and unmanaged code. 2) Setups for 32-bit Windows (.NET Framework 4.0) http://system.data.sqlite.org/sqlite-netFx40-setup-bundle-x86-2010-1.0.74.0.exe You kinda answered that question yourself “My project that is going to use this library is all .NET 4 which will be compiled to x86.”

SQLite keeps the database locked even after the connection is closed

I had the same problem using the datasets/tableadapters generated with the designer shipped with System.Data.Sqlite.dll version 1.0.82.0 — after closing the connection we were unable to read the database file using System.IO.FileStream. I was disposing correctly both connection and tableadapters and I was not using connection pooling. According to my first searches (for example this … Read more

Create/Use User-defined functions in System.Data.SQLite?

Robert Simpson has a great example of a REGEX function you can use in your sqlite queries: // taken from http://sqlite.phxsoftware.com/forums/p/348/1457.aspx#1457 [SQLiteFunction(Name = “REGEXP”, Arguments = 2, FuncType = FunctionType.Scalar)] class MyRegEx : SQLiteFunction { public override object Invoke(object[] args) { return System.Text.RegularExpressions.Regex.IsMatch(Convert.ToString(args[1]),Convert.ToString(args[0])); } } // example SQL: SELECT * FROM Foo WHERE Foo.Name REGEXP … Read more

Entity Framework 6 with SQLite 3 Code First – Won’t create tables

Edit (12.08.2021) This post/lib is about EF 6 not EF Core. If you use EF Core, code first for SQLite is supported. Initial (05.04.2015) I started with the code from fried and created a project which lets you use CodeFirst. The project is available open source on GitHub or as NuGet Package. If you encounter … Read more

SQLite Database Locked exception

Somewhere along the way a connection is getting left open. Get rid of OpenConnection and CloseConnection and change ExecuteNonQuery to this: using (SQLiteConnection c = new SQLiteConnection(ConnectionString)) { c.Open(); using (SQLiteCommand cmd = new SQLiteCommand(sql, c)) { cmd.ExecuteNonQuery(); } } Further, change the way you read data to this: using (SQLiteConnection c = new SQLiteConnection(ConnectionString)) … Read more

SQLite Insert very slow?

Wrap BEGIN \ END statements around your bulk inserts. Sqlite is optimized for transactions. dbcon = new SQLiteConnection(connectionString); dbcon.Open(); SQLiteCommand sqlComm; sqlComm = new SQLiteCommand(“begin”, dbcon); sqlComm.ExecuteNonQuery(); //—INSIDE LOOP sqlComm = new SQLiteCommand(sqlQuery, dbcon); nRowUpdatedCount = sqlComm.ExecuteNonQuery(); //—END LOOP sqlComm = new SQLiteCommand(“end”, dbcon); sqlComm.ExecuteNonQuery(); dbcon.close();

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)