Questions tagged [system.data.sqlite]

System.Data.Sqlite is an ADO.NET provider for the SQLite embedded database.

System.Data.SQLite is an ADO.NET provider for the SQLite embedded database. Its old homepage was http://sqlite.phxsoftware.com/ and currently this is where the bulk of knowledge/discussion is found, but it has recently been forked by some new folks (with blessings from the original author, Robert Simpson) and now lives at: http://system.data.sqlite.org/

Two features that make System.Data.SQLite stand out are that it is free, and that it works with things designed around ADO.NET, such as Entity Framework.

http://sqlite.org/

629 questions
545
votes
17 answers

What 'additional configuration' is necessary to reference a .NET 2.0 mixed mode assembly in a .NET 4.0 project?

I have a project in which I'd like to use some of the .NET 4.0 features but a core requirement is that I can use the System.Data.SQLite framework which is compiled against 2.X. I see mention of this being possible such as the accepted answer here…
jamone
  • 17,253
  • 17
  • 63
  • 98
175
votes
1 answer

Create SQLite Database and table

Within C# application code, I would like to create and then interact with one or more SQLite databases. How do I initialize a new SQLite database file and open it for reading and writing? Following the database's creation, how do I execute a DDL…
TinKerBell
  • 2,111
  • 2
  • 14
  • 12
121
votes
18 answers

System.Data.SQLite Close() not releasing database file

I'm having a problem closing my database before an attempt to delete the file. The code is just myconnection.Close(); File.Delete(filename); And the Delete throws an exception that the file is still in use. I've re-tried the Delete() in the…
Tom Cerul
  • 1,773
  • 2
  • 13
  • 27
72
votes
4 answers

SQLite Insert very slow?

I recently read about SQLite and thought I would give it a try. When I insert one record it performs okay. But when I insert one hundred it takes five seconds, and as the record count increases so does the time. What could be wrong? I am using the…
Verve Innovation
  • 2,006
  • 6
  • 29
  • 48
59
votes
8 answers

SQLite Database Locked exception

I am getting Database is locked exception from SQLite for some queries only. Below is my code: When I execute any select statement it works fine. When I am executing any write statement on Jobs Table it also works fine. This works fine: …
user1032317
51
votes
1 answer

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

User-Defined Functions & Collating Sequences Full support for user-defined functions and collating sequences means that in many cases if SQLite doesn't have a feature, you can write it yourself in your favorite .NET language. Writing UDF's and…
Ashlocke
  • 1,477
  • 4
  • 15
  • 13
49
votes
2 answers

Entity Framework 6 with SQLite 3 Code First - Won't create tables

Using latest versions of EF6 and SQLite from NuGet. I finally got the app.config file to work after some useful posts on Stackoverflow. Now the problem is that the tables are not being created although the database is. My app.config:
42
votes
4 answers

System.Data.SQLite vs Microsoft.Data.Sqlite

What are the differences between System.Data.SQLite and Microsoft.Data.Sqlite? I understand that System.Data.SQLite is older and got .NETStandard support after Microsoft.Data.Sqlite, but now both of them support .NETStandard 2. What are the…
bsagal
  • 591
  • 1
  • 4
  • 10
41
votes
4 answers

What is a mixed mode assembly?

I am looking at the System.Data.SQLite download page, and it lists mixed mode assembly for .NET 4 and a regular (I assume). My project that is going to use this library is all .NET 4 which will be compiled to x86. I have 2 questions: What is a…
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
41
votes
17 answers

SQLite keeps the database locked even after the connection is closed

I'm using System.Data.SQLite provider in an ASP.NET application (framework 4.0). The issue I'm running into is that when I INSERT something in a table in the SQLite database, the database gets locked and the lock isn't being released even after the…
Valerio Santinelli
  • 1,592
  • 2
  • 27
  • 45
38
votes
3 answers

What causes System.BadImageFormatException when constructing System.Data.SQLite.SQLiteConnection

I've broken the code down to the smallest possible statement: Dim cn As System.Data.SQLite.SQLiteConnection And I get the following error when calling the code from a WinForm applicaiton: System.BadImageFormatException: Could not load file or…
Tim Murphy
  • 4,892
  • 4
  • 40
  • 48
28
votes
3 answers

Adding parameters in SQLite with C#

Im just learning SQLite and I can't get my parameters to compile into the command properly. When I execute the following code: this.command.CommandText = "INSERT INTO [StringData] VALUE (?,?)"; this.data = new SQLiteParameter(); this.byteIndex =…
Brian Sweeney
  • 6,693
  • 14
  • 54
  • 69
28
votes
2 answers

In C#, is there any way to have an in-memory file linked as an in-memory SQLite database with System.Data.SQLite?

What I want to do is something along the lines of the following: using System.Data.SQLite; using System.IO; //My SQLite connection SQLiteConnection myCon; public void ReadAndOpenDB(string filename) { FileStream fstrm = new FileStream(filename,…
Mike Webb
  • 8,855
  • 18
  • 78
  • 111
26
votes
6 answers

SQLite with Entity Framework

I'm having a problem with primary keys in Entity Framework when using SQLite. SQLite wants an explicit NULL in the VALUES list on an autoincrementing primary key column. I haven't actually looked at the generated SQL in the EF Context, but I…
Dave Swersky
  • 34,502
  • 9
  • 78
  • 118
25
votes
1 answer

Sqlite Online Backup Using System.Data.Sqlite

How can a sqlite database be backed up in native C# code while the database is still online? All of the online backup api examples are in C code.
Elias
  • 1,367
  • 11
  • 25
1
2 3
41 42