system.data.sqlite

System.Data.SQLite parameterized queries with multiple values?

喜你入骨 提交于 2019-12-21 03:39:00
问题 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

Database locked in WAL mode with only readers

随声附和 提交于 2019-12-20 19:49:48
问题 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

How to dump SQLite in-memory database into file with ADO.NET?

匆匆过客 提交于 2019-12-18 16:48:23
问题 I am using System.Data.SQLite.dll to make use of the SQLite in-memory database. After the program finishes, I would like to dump the in-memory database into a .db3 file for next use. How can I achieve this in C#? 回答1: To the best of my knowledge there is not built-in functionality to accomplish this in System.Data.SQLite.dll. The functionality does however exist in the sqlite3.exe client maintained along with the SQLite core. This is how I would do it with system.data.sqlite.dll: Obtain SQL

How to dump SQLite in-memory database into file with ADO.NET?

痞子三分冷 提交于 2019-12-18 16:48:11
问题 I am using System.Data.SQLite.dll to make use of the SQLite in-memory database. After the program finishes, I would like to dump the in-memory database into a .db3 file for next use. How can I achieve this in C#? 回答1: To the best of my knowledge there is not built-in functionality to accomplish this in System.Data.SQLite.dll. The functionality does however exist in the sqlite3.exe client maintained along with the SQLite core. This is how I would do it with system.data.sqlite.dll: Obtain SQL

After SQLite update: Unable to find an entry point named 'sqlite3_changes_interop' in DLL 'SQLite.Interop.dll'

不打扰是莪最后的温柔 提交于 2019-12-18 05:39:05
问题 My C#/SQLite was working fine until I decided to update the SQLite DLLs (from 1.0.82.0 to 1.0.84.0). Now I get this crash: Unable to find an entry point named 'sqlite3_changes_interop' in DLL 'SQLite.Interop.dll' A first chance exception of type 'System.EntryPointNotFoundException' occurred in System.Data.SQLite.dll System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft

SQLite.net SQLiteFunction not working in Linq to SQL

元气小坏坏 提交于 2019-12-17 23:32:01
问题 I've created a handful of custom SQLite functions in C# using System.Data.SQLite.SQLiteFunction. It works great when using SQLiteDataAdapter to execute queries, it does not work, however, when using Linq to SQL I get errors stating that the function does not exist . I guess the bottom line is, how can I get the Custom SQLiteFunctions to work in Linq to SQL? Either by getting them to load the way they are supposed to or by modifying the source code of SQLite.Net so they are part of the dll?

SQLite.Interop.dll files does not copy to project output path when required by referenced project

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 19:14:05
问题 I am using the System.Data.SQLite Core Version: 1.0.98.1 nuget package with Visual Studio 2015. When I build my project that references my System.Data.SQLite package, it copies two folders (x86 and x64) each containing a SQLite.Interop.dll to the output directory. However when I build my test project or any other project that references the previously mentioned project, these folders do not get copied to the the parent project's output directory, and I get a DllNotFoundException on the SQLite

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

筅森魡賤 提交于 2019-12-17 18:33:07
问题 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 assembly 'System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'System.Data.SQLite, Version=1.0.65.0, Culture

How perform SQLite query with a data reader without locking database?

元气小坏坏 提交于 2019-12-13 11:36:19
问题 I am using System.Data.Sqlite to access SQLite database in C#. I have a query which must read through rows in a table. While iterating through the rows and while the reader is open, certain SQL updates must be performed. I am running into a "database is locked" exception. The SQLite documentation states: When a process wants to read from a database file, it followed the following sequence of steps: Open the database file and obtain a SHARED lock. The documentation further states about "SHARED

Does Entity Framework + System.Data.SQLite provide a Database changed from outside listener / event?

白昼怎懂夜的黑 提交于 2019-12-13 04:00:25
问题 Is there a way to get notified, when the database is newer than the DbContext of EF? In my case I develop an application that can be installed on several computers. They use the same Database. Since these applications are supposed to run the whole day, chances are high that one is updating data and the other instance of the application is still holding old data in its DbContext. Now I could implement some checking for new data each minute or so. Or checking for new data each time the user