system.data.sqlite

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

不打扰是莪最后的温柔 提交于 2019-11-26 12:40:25
问题 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 collating sequences has never been easier I spotted this bit on the C# SQLite ADO.NET provider l found here, and was having problems understanding the documentation on how to implement/use user-defined functions. Could anyone explain how to, or

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

让人想犯罪 __ 提交于 2019-11-26 12:15:58
问题 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: <?xml version=\"1.0\" encoding=\"utf-8\"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name=\"entityFramework\" type=\"System.Data.Entity.Internal

SQLite keeps the database locked even after the connection is closed

百般思念 提交于 2019-11-26 10:56:25
问题 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 connection is disposed. When trying to access the file, the error is: \"The process cannot access the file \'catalog.sqlite\' because it is being used by another process.\" My code is pretty straightforward, I open the connection, read some data

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

被刻印的时光 ゝ 提交于 2019-11-26 07:53:51
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 debugger after a few minutes, so it's not a timing issue. I have transaction code but it doesn't run at all before the Close() call. So I'm fairly sure it's not an open transaction. The sql commands between open and close are just selects. ProcMon shows my program and my antivirus looking at the database file. It does not show my program releasing the db

Create SQLite Database and table [closed]

岁酱吖の 提交于 2019-11-26 06:54:42
问题 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 statement to create a table? 回答1: The next link will bring you to a great tutorial, that helped me a lot! How to SQLITE in C# *domain is marked as inactive. I nearly used everything in that article to create the SQLite database for my own C#

Adding parameters in SQLite with C#

僤鯓⒐⒋嵵緔 提交于 2019-11-26 05:35:03
问题 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 = new SQLiteParameter(); this.command.Parameters.Add(this.data); this.command.Parameters.Add(this.byteIndex); this.data.Value = data.Data; this.byteIndex.Value = data.ByteIndex; this.command.ExecuteNonQuery(); I get a SQLite Exception. Upon

SQLite Database Locked exception

只谈情不闲聊 提交于 2019-11-26 04:25:24
问题 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: ExecuteNonQuery(\"DELETE FROM Jobs WHERE id=1\"); But the same way if I am executing queries for Employees table it is throwing an exception that database is locked . This throws Exception: ExecuteNonQuery(\"DELETE FROM Employees WHERE id=1\"); Below are my

SQLite Insert very slow?

风格不统一 提交于 2019-11-26 03:55:43
问题 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 SQLite Wrapper (system.data.SQlite) : dbcon = new SQLiteConnection(connectionString); dbcon.Open(); //---INSIDE LOOP SQLiteCommand sqlComm = new SQLiteCommand(sqlQuery, dbcon); nRowUpdatedCount = sqlComm.ExecuteNonQuery(); //---END LOOP dbcon.close(

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

戏子无情 提交于 2019-11-26 01:58:46
问题 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 debugger after a few minutes, so it\'s not a timing issue. I have transaction code but it doesn\'t run at all before the Close() call. So I\'m fairly sure it\'s not an open transaction. The sql commands between open and close are just selects. ProcMon

What &#39;additional configuration&#39; is necessary to reference a .NET 2.0 mixed mode assembly in a .NET 4.0 project?

╄→尐↘猪︶ㄣ 提交于 2019-11-25 23:13:39
问题 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 but I don\'t see how to actually achieve this. When I just try and run my 4.0 project while referencing the 2.X assembly I get: Mixed mode assembly is built against version \'v2.0.50727\' of the runtime and cannot be loaded in the 4.0 runtime