Questions tagged [sqlite-net-pcl]
69 questions
                    
                    22
                    
            votes
                
                17 answers
            
        The type initializer for 'SQLite.SQLiteConnection' threw an exception
I'm trying to implement an incredibly basic use of SQLite. I have a Button and an EditText. I want to store the contents of the EditText OnClick. 
I'm following this:…
         
    
    
        Jacob Barnes
        
- 1,480
- 1
- 12
- 29
                    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
                    6
                    
            votes
                
                3 answers
            
        SQLite no longer seems to work on xamarin android
We have a Xamarin.Forms project that needed to use the sqlite local db to store date. EF Core's sqlite library was used to set this up and by different developers from different PCs (vs 2019). Initially, it was used with the Database.EnsureCreated()…
         
    
    
        Neville Nazerane
        
- 6,622
- 3
- 46
- 79
                    6
                    
            votes
                
                0 answers
            
        Could not load file or assembly 'e_sqlite3
When I debug my UWP project I get the following error:
System.IO.FileNotFoundException: 'Could not load file or assembly
  'e_sqlite3, Culture=neutral, PublicKeyToken=null'. The system cannot
  find the file specified.'
The error occurs on this…
         
    
    
        Carlin Baert
        
- 81
- 3
                    3
                    
            votes
                
                2 answers
            
        Is there a right way to add an existing SQLite database to a Xamarin project?
Every example I've found creates the database for you and then has you create tables and populate them in code. My problem, though, is that I would like to create and populate the database elsewhere (SQLiteStudio) and then include it in my app.
I…
         
    
    
        user875234
        
- 2,399
- 7
- 31
- 49
                    2
                    
            votes
                
                1 answer
            
        How do I provide a list as my parameter in sqlite-net
I am building a Xamarin Forms application and using Sqlite-net. I want to run a delete query that deletes all records that have a field in a list so something like below:
//usersToDelete is a list of Objects each representing a user.
List… 
         
    
    
        Kikanye
        
- 1,198
- 1
- 14
- 33
                    2
                    
            votes
                
                1 answer
            
        JIT issues with IOS Xamarin SQLite
So I have some classes that I have been storing in a local SQLite DB in a Xamarin Forms application. Works fine on UWP, Android, and iOS except for Release on a physical device. Keep getting JIT warnings. I've tried removing linking various ways to…
         
    
    
        Christopher Richmond
        
- 612
- 4
- 12
                    2
                    
            votes
                
                1 answer
            
        SQLite-Net-Pcl in Xamarin.Forms
I am trying to learn SQLite and its usage from Xamarin.Forms. I found that it is recommended to install Sqlite-net-pcl as NuGet package and make use of it to create, open, modify a database. Up to that point everything is fine. However, I am…
         
    
    
        TiTus
        
- 77
- 9
                    2
                    
            votes
                
                0 answers
            
        Do I need to call lock() in a method with SQLite when doing an update?
I have methods for updating data in my SQLite database looking like this:
public void IncrementPoints(Phrase phrase, int pts)
{
    lock (l)
    {
        db2.Execute("UPDATE phrase SET Points = Points + " + pts +
                    " WHERE…
         
    
    
        Alan2
        
- 23,493
- 79
- 256
- 450
                    2
                    
            votes
                
                1 answer
            
        Xamarin Forms can't create SQLite database
I'm building a new project using Xamarin.Forms and I wanted to use SQLite to store the user data. I'm using .Net standard project.
I installed the sqlite-net-pcl NuGet package by Frank A. Krueger in all 4 projects (shared code, droid, ios and uwp).…
         
    
    
        David AK
        
- 125
- 1
- 14
                    2
                    
            votes
                
                1 answer
            
        How to avoid AggregateException that contains a TypeInitializationException when creating a table with sqlite
In my DB ctor:
databasePath = GetPath(docsFolder);
connection = new SQLiteAsyncConnection(databasePath);
connection.CreateTableAsync().Wait();
Database path is 
/data/user/0/com.companyname.AppName/files/fn.db3
(Package name filtered only… 
         
    
    
        mnemonic
        
- 1,605
- 2
- 17
- 26
                    2
                    
            votes
                
                2 answers
            
        How to connect two tables in Xamarin Forms?
This might be a silly question but I am having trouble saving in sqlite. I have used facebook login from XF successfully, but also want to save the info from there in sqlite-net-pcl. Two models are: 
public class FacebookProfile
    {
        public…
         
    
    
        suman_dh
        
- 39
- 6
                    1
                    
            vote
                
                0 answers
            
        SQLite.SQLiteException: table RecipePage has no column named IdIngredients
I am working on a .Net MAUI app that uses sqlite-net-pcl and sqlite-net-extensions. My goal is to make a RecipeBook like app. For that I need to have a database, here is the concept so far, that I want to make: Hope you can read everything.
So far I…
         
    
    
        Bence Hérincs
        
- 21
- 3
                    1
                    
            vote
                
                1 answer
            
        Xamarin Cannot compile: Parameter System.Collections.Generic.List`1[T] queryArgs
I have a problem with a query of SQLite Xamarin
I have installed sqlite-net-pcl 1.7.335 and SQLiteNetExtensions 2.0.0
The process of error is the next:
I fill the variable nuevoRegistro:…
         
    
    
        Santiago Vasquez
        
- 149
- 1
- 10
                    1
                    
            vote
                
                2 answers
            
        How to use Immutable Objects with SQLite?
I keep getting the following error when trying to initialize my SQLite-NET database:
Cannot create a table without columns (does 'PersonModel' have public properties?)
I have a class PersonModel that I want to be immutable, however SQLite is…
         
    
    
        Brandon Minnick
        
- 13,342
- 15
- 65
- 123