Questions tagged [sqlite-net]

sqlite-net is an open source, minimal library to allow .NET and Mono applications to store data in SQLite 3 databases.

sqlite-net is an open source, minimal library to allow .NET and Mono applications to store data in [http://www.sqlite.org SQLite 3 databases]. It is written in C# and is meant to be simply compiled in with your projects. It was first designed to work with MonoTouch on the iPhone, but has grown up to work on all the platforms (Mono for Android, .NET, Silverlight, WP7, WinRT, Azure, etc.).

sqlite-net was designed as a quick and convenient database layer. Its design follows from these goals:

  • Very easy to integrate with existing projects and with MonoTouch projects.

  • Thin wrapper over SQLite and should be fast and efficient. (The library should not be the performance bottleneck of your queries.)

  • Very simple methods for executing CRUD operations and queries safely (using parameters) and for retrieving the results of those query in a strongly typed fashion.

  • Works with your data model without forcing you to change your classes. (Contains a small reflection-driven ORM layer.)

  • Zero dependencies aside from a compiled form of the sqlite2 library.

Non-goals include:

  • Not an ADO.NET implementation. This is not a full SQLite driver. If you need that, use Mono.Data.SQLite or csharp-sqlite.

https://github.com/praeclarum/sqlite-net

463 questions
33
votes
2 answers

Class Property Not be included as sqlite database column

I have one entity class as public class someclass { public string property1 {get; set;} public string property2 {get; set;} public string property3 {get; set;} } and using sqlite connection class obj DB I am creating the…
Shafqat Masood
  • 2,532
  • 1
  • 17
  • 23
30
votes
2 answers

Generic Repository for SQLite-Net in Xamarin Project

I am wondering if there is a way to write a generic repository for my Xamarin project versus writing a different Repository for each entity in my object. The Xamarin Tasky Pro example have one Repository for the Task entity because that is the only…
Val Okafor
  • 3,371
  • 13
  • 47
  • 72
21
votes
1 answer

C# SQLite-net define multi column unique

I have seen references to changes in SQLite-net that supports multi-column unique constraints. I know it can be done directly with sqlite however I prefer to stay wit the sqlite-net methods of doing things. What is the Syntax to do multi-column…
Donald French
  • 1,731
  • 1
  • 17
  • 30
16
votes
2 answers

Table has no (public) columns only on real device

I have the simplest of apps that I thought I would try on my device before I got too engrossed. However, I am getting the strangest error message when I run it on my iPhone (as apposed to the the emulator on my macbook). Table has no (public)…
Daniel Casserly
  • 3,552
  • 2
  • 29
  • 60
15
votes
7 answers

Unable to load DLL sqlite3 in Universal Windows App running on Mobile

I am developing a UWP. I am using the sqlite-net-pcl library. After upgrading my Application from RC to RTM , I got a runtime error - sqlite3.dll could not be found - if it runs on a Mobile emulator or a device. It worked prefectly after I added a…
Stam
  • 2,410
  • 6
  • 32
  • 58
13
votes
3 answers

Can I use a List of String in a class intended for SQLite?

What limitations are there on data types used in a class that will be used by SQLite-net to represent a table? Specifically, can I use this: public List CoconutWaterBrands { get; set; } ...or will I need this: public string[]…
11
votes
2 answers

How to make SQLite foreign keys with SQLite.Net-PCL

In UWP, I enjoy the benefits of using SQLite.Net-PCL, creating classes to be used in apps as ObservableCollections to bind to the GridView. After including SQLiteNetExtensions to build a database with foreign keys, I've noticed that the foreign…
detailCode
  • 537
  • 1
  • 8
  • 22
10
votes
2 answers

How to Update row in sqlite.net pcl in windows 10 C#?

I have ID of Row then I will update other values. I don't know how to update my values! My Table: class MyTable { [PrimaryKey, AutoIncrement] public int Id { get; set; } public string Date { get; set; } public string Volumes { get;…
radin
  • 251
  • 3
  • 16
10
votes
3 answers

Sqlite extension is not working as expected

I am working on an WinRT app. I want to use sqlite-net-extensions to support OneToMany, ManyToMany. using SQLiteNetExtensions.Attributes; using SQLite; [Table("WorkFlow")] public class Workflow { [PrimaryKey, AutoIncrement] public int…
9
votes
1 answer

Creating a ManyToMany relationship between two models

I'm new to creating a Windows Store app and it requires a use of a database. I've settled for sqlite and am using the sqlite-net package. However, I'm unsure of how to create a m2m relationship between two models. class ModelA { [PrimaryKey,…
SunnySydeUp
  • 6,680
  • 4
  • 28
  • 32
8
votes
4 answers

Unable to load DLL 'e_sqlite3': The specified module could not be found

I have a Xamarin Forms solution. I added sqlite-net-pcl as reference to all projects. It works fine on Android but crashes on Windows 8.1 and Windows Phone 8.1. I have an IOS project but I don't have OSX at the moment to try it. I use this in the…
Péter Aradi
  • 370
  • 1
  • 4
  • 12
8
votes
3 answers

SQLite.net table query throws NullReferenceException

I'm using the following line of code to query some data from a given table in a SQLite database (platform is WP81 but I guess this doesn't matter here). return await Connection.Table().Where(wd => wd.Date >= @from && wd.Date <=…
Stephan
  • 1,791
  • 1
  • 27
  • 51
7
votes
3 answers

libSQLite.Interop not found Mac OS | M1

I am using dotnet 6 on a M1 Pro, and am struggling to use the SQLite-Package. System.DllNotFoundException: Unable to load shared library 'SQLite.Interop.dll' or one of its dependencies. This is the error that is thrown, whenever I try to run the…
Linsane
  • 338
  • 4
  • 16
7
votes
4 answers

sqlite-net-pcl SqliteAsyncConnection.CreateTableAsync throws System.MissingMethodException

I am trying to create a table using the latest version of sqlite-net-pcl nuget package var db = new SQLiteAsyncConnection("data.db"); await db.CreateTableAsync(); The CreateTableAsync call throws the following…
JohnWick
  • 4,929
  • 9
  • 37
  • 74
7
votes
5 answers

SQLite-net-pcl - Always returning ID as 0 (Xamarin)

I recently moved across from SQLite.NET to SQLite-net-pcl due to the Android 7.0 SQlite issue. In the process I have updated all my libraries and all is working well with regards to insert/drop etc. The only issue I have is that every time I…
Phill Wiggins
  • 2,577
  • 4
  • 28
  • 33
1
2 3
30 31