system.data.sqlite

sqlite: Fastest way to get all rows (consecutive disk access)

情到浓时终转凉″ 提交于 2019-12-05 02:00:04
问题 I want to read all rows in a table using system.data.sqlite. As I have a very big Table (>450GB, with > 6 billion rows) I want to be sure that sqlite will use consequtive disk access. As you may know a random access to hard disk is slow. Due to memory restictions I can not load all the data at once. So the optimal way would be if sqlite reads some hundred MB (consecutive), then I work with this data and sqlite reads the next. How can I be sure that sqlite will do disk access this way and not

How does the SQLite Entity Framework 6 provider handle Guids?

我与影子孤独终老i 提交于 2019-12-05 01:20:17
I am porting our product's database to SQLite from another product that supported Guids. As we know, SQLite does not support Guids. I've got created an entity framework 6 model from my database (database first) and I need to build a query from C# that compares the Guid to one passed from the code. The thing is I can't find any documentation on how the SQLite Entity Framework provider handles Guids. A web search didn't find anything useful for me, either. Just questions about using Entity Framework with SQLite. Can anybody point me to the documentation, or maybe tell me how to work with Guids

Error using System.Data.Linq.Mapping and auto incrementing the primary key in a sqlite db

南楼画角 提交于 2019-12-04 13:06:57
问题 I'm using SQLite and System.Data.Linq.Mapping . I'm having an issue with the id AUTOINCREMENT field when using the linq mapping attribute IsDbGenerated = true . Syntax to create my table. I've tried this with/without the AUTOINCREMENT CREATE TABLE [TestTable] ([id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,[title] TEXT NULL) My TABLE class: [Table(Name = "TestTable")] public class TestTable { [Column(IsPrimaryKey = true, IsDbGenerated =true)] public int id { get; set; } [Column] public

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-04 11:37:55
问题 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? 回答1: As the other answerer mentioned, SQLite integer is stored

Improve large data import performance into SQLite with C#

廉价感情. 提交于 2019-12-04 10:05:33
问题 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;

Adding “System.Data.SQLite” as a reference

♀尐吖头ヾ 提交于 2019-12-04 05:11:18
when i was building my project done in asp.net & c#.net ,it produced the error as "The type or namespace name 'SQLite' does not exist in the namespace 'System.Data' (are you missing an assembly reference?" so, when i tried to add it as reference ,i was not able to find "System.Data.SQLite" in my library . how to overcome this problem.? Jojo Sardez Try to search for System.Data.SQLite.DLL file (using windows explorer search) or if you have not yet installed it just download it from the net. For more information try to read this . You get it (as a dll), then add a reference to it. download here

Advantages and Disadvantages of SQLite.NET and SQL Server Compact

♀尐吖头ヾ 提交于 2019-12-04 04:35:53
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, and if someone can tell me the main differences between them, mostly speed, file size, reliability, and

Do I have to Dispose the SQLiteCommand objects?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 03:31:27
问题 How do I treat the SQLiteCommand object, do I have to call Dispose() after ExecuteScalar , ExecuteNonQuery and ExecuteReader or not? The documentation example on SQLiteCommand doesn't dispose it whilst in the SQLiteTransaction the example disposes the SQLiteCommand object. I always close the data reader object though. My application accesses the db from many threads. Mostly I am interested in not leaking connections or disturbing SQLite. I am aware of using and IDisposable usage 回答1: It's

Identity column maximum value in SQLite DBs

↘锁芯ラ 提交于 2019-12-04 02:52:17
I have a purely academic question about SQLite databases. I am using SQLite.net to use a database in my WinForm project, and as I was setting up a new table, I got to thinking about the maximum values of an ID column. I use the IDENTITY for my [ID] column, which according to SQLite.net DataType Mappings , is equivalent to DbType.Int64 . I normally start my ID columns at zero (with that row as a test record) and have the database auto-increment. The maximum value ( Int64.MaxValue ) is 9,223,372,036,854,775,807. For my purposes, I'll never even scratch the surface on reaching that maximum, but

How should I disable Entity Framework table reference(foreign) list from each objects?

偶尔善良 提交于 2019-12-04 01:01:17
问题 I'm using Sqlite database and System.Data.SQLite 1.0.92 There is 2 table here: Table Person : PersonId PersonName Table Student : StudentId PersonId(reference table Person FK) StudentNo Now every time I get the Persons Collection in EF5: using (var ctx = new myEntities) { AllPersons = ctx.Persons.ToList(); } There is also has AllPersons.student collection will include in the result; But I don't need it. Of course that's just an example, There is a lot of big table has so many references, it