system.data.sqlite

Getting table schema doesn't seem to work with System.Data.SQLite

懵懂的女人 提交于 2019-12-10 16:23:46
问题 I'm using SQLite.NET to access my databases, and in one particular case, I need to get a table schema because it's application-specific. I've been looking through the SQLite.NET forum and google, and it seems very straightforward. If I have a table called MYTABLE, I should be able to do this: DataTable dt = Connection.GetSchema( SQLiteMetaDataCollectionNames.Columns, new string[] { null, null, "MYTABLE", null }); The problem is that, although I do get a DataTable back, it's got all of the

Why is the SQLite provider missing from the Server Explorer Add Connection dialogue?

时光毁灭记忆、已成空白 提交于 2019-12-10 14:35:51
问题 I am following the article Using SQLite Embedded Database with Entity Framework and Linq-to-SQL, and have tried installing the SQLite provider, first using the System.Data.SQLite NuGet package, and then by installing the provider via the Setups for 32-bit Windows (.NET /Framework 4.0) installer package (for v1.0.79). After both installs, and a system restart, I still see no SQLite Database File provider in the Add Connection dialogue from Server Explorer. I can proceed by manually creating a

Read only access only for sqlite3 from multiple threads

北战南征 提交于 2019-12-10 14:29:10
问题 According to http://www.sqlite.org/threadsafe.html there are three different threading modes when working with sqlite: single-threaded , multi-threaded and serialized . When configured to serialized and multi-threaded modes, mutexes are used (depending on the mode they are used more or less) and in single-threaded mode mutexes are not used at all. Assuming that the database will only be used for queries (read-only access) is it possible to use the single-threaded mode while still accessing it

System.Data.SQlite for Visual Studio 2013

。_饼干妹妹 提交于 2019-12-10 14:19:47
问题 The current distribution for System.Data.SQLite does not work with Visual Studio 2013 unless you deploy the VS2012 Update3 release pack (presumably) or just install (on a test machine like I did) the full version. Does anyone know when the System.Data.SQLite team will release builds for Visual Studio 2013, both the precompiled static libraries that I would distribute to a customer and the full designer version that I would use? The current release as of this post is 1.0.89.0, which does not

On some computers application can't load sqlite dll file

[亡魂溺海] 提交于 2019-12-10 13:59:52
问题 I wrote an application that uses sqlite and it works great on most of the systems. It is written in C#, and the only non-framework assembly is sqlite, which is included by System.Data.SQLite.dll . I deploy it the same way on all of the machines (copy pasting the exe file, the database file and the System.Data.SQLite file). It works great for all my PC's and most of the PC's I've tried. But then I've got reports that for some people it throws the following exception: Could not load file or

x86 and x64 System.Data.SQLite issue

与世无争的帅哥 提交于 2019-12-10 12:18:22
问题 I found a lot of questions about this problem but did not find any answers. I have a rather strange problem. When I add a 32bit reference for System.Data.SQLite to my project it only works on x86 platform, and that should be fine by me as my app will run only on 32bit Windows. But when I try to run the app on 32bit Windows it throws the exception Could not load file or assembly 'System.Data.SQLite' . Then I downloaded 64bit version of System.Data.SQLite dll . Then I could start debug with ANY

How to escape a string in system.data.sqlite?

不羁的心 提交于 2019-12-10 11:19:41
问题 I am executing an SQL query (system.data.SQLite) like so: var color = "red"; var command = new SQLiteCommand("SELECT something FROM tabletop WHERE color = '" + color + "'", Connection); var reader = command.ExecuteReader(); The color variable is a text supplied by the user. How can I escape this text to prevent SQL injection? Or is this bad practice and I should execute the query in some entirely different "protected" way? 回答1: You should use parameterized queries: var command = new

LINQ-to-SQL with SQLite: syntax error near “SELECT” when inserting

强颜欢笑 提交于 2019-12-10 10:47:37
问题 I have been using the System.Data.SQLite provider for my application. When I try to create a new object and insert it into the database, however, I get a SQL syntax error near "SELECT" . Basically my code looks like: //supplies is a DataContext connected to my DB Table<Store> stores = supplies.Stores; //... Store newStore = new Store(); // A Store has an Id (pk autoincrement), Name, Number, and EntitySet<Usages> newStore.Name = "New Store"; newStore.Number = 0; //... stores.InsertOnSubmit

Advantages and Disadvantages of SQLite.NET and SQL Server Compact

邮差的信 提交于 2019-12-09 17:16:06
问题 I have used SQLite.NET many times. It always worked fine but I have a friend that is really pestering me that I should use instead SQL Server Compact so I stayed fully in Microsoft environment. Now, I never worked with Compact, and he tells me it works fine for him, but seeing that .MDF extension gives me the creeps. No kidding. Last thing I want is my application relying on an Access database. Since I have never really worked with it, I am asking if someone here knows it to vouche for it,

Performance issues to iterate results with C# SQLite DataReader and attached database

天大地大妈咪最大 提交于 2019-12-08 15:59:05
问题 I am using System.Data.SQLite and SQLiteDataReader in my C# project. I am facing performance issues when getting the results of a query with attached databases. Here is an example of a query to search text into two databases : ATTACH "db2.db" as db2; SELECT MainRecord.RecordID, ((LENGTH(MainRecord.Value) - LENGTH(REPLACE(UPPER(MainRecord.Value), UPPER("FirstValueToSearch"), ""))) / 18) AS "FirstResultNumber", ((LENGTH(DB2Record.Value) - LENGTH(REPLACE(UPPER(DB2Record.Value), UPPER(