system.data.sqlite

C# Windows Forms + Windows 7 + System.Data.SQLite v.1.0.66.0 = crash?

夙愿已清 提交于 2020-01-26 03:24:48
问题 Hey guys, I'm currently experiencing a very strange crash in Windows 7 in a C# Windows Forms application developed in Visual Studio 2008. The app - which works great in both XP and Vista - never really opens; instead, a "this application has caused an error and has stopped working". I made a dummy application with the following source-code: using System; using System.Windows.Forms; using System.Data.Common; using System.Data.SQLite; namespace TesteWin7 { public partial class Form1 : Form {

C# Windows Forms + Windows 7 + System.Data.SQLite v.1.0.66.0 = crash?

南笙酒味 提交于 2020-01-26 03:24:12
问题 Hey guys, I'm currently experiencing a very strange crash in Windows 7 in a C# Windows Forms application developed in Visual Studio 2008. The app - which works great in both XP and Vista - never really opens; instead, a "this application has caused an error and has stopped working". I made a dummy application with the following source-code: using System; using System.Windows.Forms; using System.Data.Common; using System.Data.SQLite; namespace TesteWin7 { public partial class Form1 : Form {

With System.Data.SQLite how do you specify a database file in the connect string using a relative path

旧街凉风 提交于 2020-01-19 11:21:05
问题 Wanting to deploy my project on different servers I would prefer to be able to specify a connect string using a relative path. I can't seem to get that to work and want to know if there is some trick to it...? 回答1: A suggestion You could build the absolute path in the app and pass that in the connection string. So, if you know that the database file is in the database subfolder of the application folder, you could do something like this (C#): string relativePath = @"database\myfile.s3db";

With System.Data.SQLite how do you specify a database file in the connect string using a relative path

送分小仙女□ 提交于 2020-01-19 11:14:58
问题 Wanting to deploy my project on different servers I would prefer to be able to specify a connect string using a relative path. I can't seem to get that to work and want to know if there is some trick to it...? 回答1: A suggestion You could build the absolute path in the app and pass that in the connection string. So, if you know that the database file is in the database subfolder of the application folder, you could do something like this (C#): string relativePath = @"database\myfile.s3db";

With System.Data.SQLite how do you specify a database file in the connect string using a relative path

我是研究僧i 提交于 2020-01-19 11:13:11
问题 Wanting to deploy my project on different servers I would prefer to be able to specify a connect string using a relative path. I can't seem to get that to work and want to know if there is some trick to it...? 回答1: A suggestion You could build the absolute path in the app and pass that in the connection string. So, if you know that the database file is in the database subfolder of the application folder, you could do something like this (C#): string relativePath = @"database\myfile.s3db";

Method Optimisation - C#

眉间皱痕 提交于 2020-01-15 05:22:28
问题 I've developed a method that allows me to pass in a table (string), array of columns (string) and array of values (object) through the parameters which I then use to create a parameterized query. Although it works fine the length of the code as well as the multiple for loops gave off a code smell, in particular I feel the method I use to insert a comma between the columns and values can be done a different and better way. public static int Insert(string source, string[] column, object[]

C# query datetime off sqlite database fails

怎甘沉沦 提交于 2020-01-05 09:01:48
问题 I am reading a sqlite file in which datetime column data are saved as integer values (INTEGER NO NULL) DateTime dt=reader.GetDateTime(nColDateTime); But it emits an error saying that the return value is not in correct format. I try out all other available methods in Datetime class and find only DateTime dt=DateTime.FromBinary(reader.GetInt64(nColDateTime)); works (as others return exceptions). But the formatted date (as dt.ToShortDateTime()) is incorrect (ie 0042/11/20) I have no idea what

SQLite: .Net much slower than native?

两盒软妹~` 提交于 2020-01-04 02:07:08
问题 Here is my query: SELECT * FROM [GeoName] WHERE ((-26.3665122100029-Lat)*(-26.3665122100029-Lat))+((27.5978928658078-Long)*(27.5978928658078-Long)) < 0.005 ORDER BY ((-26.3665122100029-Lat)*(-26.3665122100029-Lat))+((27.5978928658078-Long)*(27.5978928658078-Long)) LIMIT 20 This returns the 20 closest points. Running this in native sqlite returns a result within 78ms, but from within the .Net sqlite environment it takes nearly 1400ms. Any suggestions? I have this query within my ORM structure

Difficulty running concurrent INSERTS on SQLite database in C#

∥☆過路亽.° 提交于 2020-01-02 06:33:40
问题 I'm running a number of threads which each attempt to perform INSERTS to one SQLite database. Each thread creates it's own connection to the DB. They each create a command, open a Transaction perform some INSERTS and then close the transaction. It seems that the second thread to attempt anything gets the following SQLiteException: The database file is locked. I have tried unwrapping the INSERTS from the transaction as well as narrowing the scope of INSERTS contained within each commit with no

How to read a SQLite database into a DataGridView object

耗尽温柔 提交于 2019-12-25 01:48:58
问题 I am writing a VB program using VS 2013. I am using the methods in System.Data.SqLite.dll from SQLite.org. I can read my database fine into a ListBox object. I am posting my code that I am using for this. What I would like to do is send this data to a DataGridView object. I am having no luck doing it correctly. Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click Dim f As New OpenFileDialog f.Filter = "SQLite 3 (*.db)|*.db|All Files|*.*" If f.ShowDialog() =