system.data.sqlite

'The database file is locked' with System.Data.SQLite

谁说我不能喝 提交于 2019-12-03 18:07:46
问题 I am suddenly getting the following errors from SQLite after adding a new transaction: The database file is locked database is locked Has anyone seen this? I added an update transaction (following some successful selects/inserts). I can't find anything different about this one... 回答1: I figured it out. From looking at this [really old] thread on the phxsoftware site, it seems like there can be locking problems if you don't immediately dispose of readers and commands after executing them. I

EntryPointNotFoundException in SQLite after displaying FolderBrowserDialog

微笑、不失礼 提交于 2019-12-03 18:06:07
问题 When using a 64-bit program System.Data.SQLite is throwing the following EntryPointNotFoundException: Unable to find an entry point named 'sqlite3_changes_interop' in DLL 'SQLite.Interop.dll'. Strangely it only occurs if Foreign Keys=True is specified in the connection string and more importantly only after I display a FolderBrowserDialog . I was browsing for a folder to display databases to load. The following code displays the problem: public Form1() { InitializeComponent(); // Exception

System.Data.SQLite parameterized queries with multiple values?

◇◆丶佛笑我妖孽 提交于 2019-12-03 11:02:28
I am trying to do run a bulk deletion using parameterized queries. Currently, I have the following code: pendingDeletions = new SQLiteCommand(@"DELETE FROM [centres] WHERE [name] = $name", conn); foreach (string name in selected) pendingDeletions.Parameters.AddWithValue("$name", name); pendingDeletions.ExecuteNonQuery(); However, the value of the parameter seems to be overwritten each time and I end up just removing the last centre. What is the correct way to execute a parameterized query with a list of values? foreach (string name in selected) { pendingDeletions.Parameters.AddWithValue("$name

System.Data.Sqlite not being recognized by Visual Studio 2010 on Win 2K8 Server machine

风格不统一 提交于 2019-12-03 09:55:48
问题 I have a Windows Server 2008 (64-bit) box that I am doing development on. I've installed Visual Studio 2010 and System.Data.SQLite (from sqlite.phxsoftware.com). My problem is that the former is not seeing the latter. That is, when I go to the Server Explorer in Visual Studio and select "Connect to Database" and the "Choose Data Source" window appears, SQLite does not appear under the list of data sources. Anyone know what the deal is with that? Could it be an issue with Windows Server 2008

When i select from sqlite column of type 'int' I can cast to .net int but when I select from 'integer' column I cannot

坚强是说给别人听的谎言 提交于 2019-12-03 07:21:53
I'm using System.Data.SQLite, selecting from a sqlite database table where a column has type 'integer', and when I do something like this: int x = (int)reader["myColumn"]; it fails. The problem is not that the value is null; the column is not nullable. If I change the data type of the column to 'int' then it works fine. The values in the column are '2', '3', '4', etc.; nothing very big. Anyone know if this is expected behaviour? As the other answerer mentioned, SQLite integer is stored in 1, 2, 3, 4, 6, or 8 bytes. However, you won't get overflow or out of range exceptions. In that context,

Database locked in WAL mode with only readers

孤街醉人 提交于 2019-12-03 06:18:20
Using System.Data.Sqlite 1.0.86.0 (including SQLite 3.7.17) in Write-Ahead Logging mode, I'm experiencing database locks while reading concurrently, which shouldn't be the case if I understand WAL correctly. I'm not writing or committing anything and the ReadCommitted transaction isolation mode is correctly used to avoid serializing reads. SQLite DB (with WAL) locked when preparing a "select" statmement - why? is a similar issue. The only answer talks about calling sqlite3_reset after each sqlite3_step , which is done correctly by System.Data.Sqlite as far as I saw in the source code. Full

Improve large data import performance into SQLite with C#

时光总嘲笑我的痴心妄想 提交于 2019-12-03 05:54:01
I am using C# to import a CSV with 6-8million rows. My table looks like this: CREATE TABLE [Data] ([ID] VARCHAR(100) NULL,[Raw] VARCHAR(200) NULL) CREATE INDEX IDLookup ON Data(ID ASC) I am using System.Data.SQLite to do the import. Currently to do 6 millions rows its taking 2min 55 secs on a Windows 7 32bit, Core2Duo 2.8Ghz & 4GB RAM. That's not too bad but I was just wondering if anyone could see a way of importing it quicker. Here is my code: public class Data { public string IDData { get; set; } public string RawData { get; set; } } string connectionString = @"Data Source=" + Path

SQLite with Entity Framework

对着背影说爱祢 提交于 2019-12-03 02:20:28
问题 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 believe it's going with the usual SQL Server convention of providing no value for the autoincrementing column. According to the site for the ADO.NET SQLite provider, EF is fully supported but I'm finding no help there. Is there a way to force EF to

System.Data.Sqlite not being recognized by Visual Studio 2010 on Win 2K8 Server machine

ぃ、小莉子 提交于 2019-12-03 00:26:38
I have a Windows Server 2008 (64-bit) box that I am doing development on. I've installed Visual Studio 2010 and System.Data.SQLite (from sqlite.phxsoftware.com). My problem is that the former is not seeing the latter. That is, when I go to the Server Explorer in Visual Studio and select "Connect to Database" and the "Choose Data Source" window appears, SQLite does not appear under the list of data sources. Anyone know what the deal is with that? Could it be an issue with Windows Server 2008 because in the past I've no issues with VS 2010 + System.Data.Sqlite on a Windows 7 box. Update: System

Compile System.Data.Sqlite With AES256

倾然丶 夕夏残阳落幕 提交于 2019-12-02 18:12:19
问题 I'm knee deep in compilation for sqlite, system.data.sqlite, and xerial's JDBC trying to get an encrypted sqlite file working through all three. From my understanding, system.data.sqlite uses RC4 encryption, and SQLCipher/Rijndael/wxSqlite can use AES256. Using this library, one can easily compile Windows binaries for AES256 encryption. This library offers Xerial's JDBC by incorporating wxsqlite3's improvements, which it looks like is actually based on the above (Rijndael's) library. Because