Questions tagged [sqlite-net-pcl]

69 questions
0
votes
0 answers

Clearing a SQLite table before saving data in it

I'm using SQLite.net (https://github.com/praeclarum/sqlite-net) in my Xamarin Forms project and trying to save a user's projects in the database. In order to make sure there won't be any duplicates, I want to first clear the table by calling: await…
Sam
  • 26,817
  • 58
  • 206
  • 383
0
votes
0 answers

C# Is there a way to fill in a variable for the generic T SQLiteConnection Table?

I want to loop through different tables in a SQLite database and perform the same actions. The T in Table expects a class name that matches a table name and functions as a container for the data in that table. I want to do something like this: For…
Nicholas
  • 23
  • 4
0
votes
0 answers

Java.Lang.IndexOutOfBoundsException error when calling CreateTableAsync from SQLite-net-pcl on Xamarin Forms - Android

After the last visual studio upgrade I'm now getting the error Java.Lang.IndexOutOfBoundsException: 'index=538968388 out of bounds (limit=591768, nb=2)' when calling await db.CreateTableAsync(); on Xamarin Forms - Android. Works fine with UWP.
Jim
  • 73
  • 3
0
votes
1 answer

SQLite Database problem in Xamarin Forms (sqlite-net-pcl) - "DatabasePath must be specified"

I'm writing a simple Xamarin Forms mobile app (Android and iOS, but focusing on Android for now) as a school project. I'm using Visual Studio 2019 Community and I have installed the NuGet package sqlite-net-pcl v1.7.335 Everything was moving along…
rlacos1
  • 13
  • 2
0
votes
2 answers

sqlite-net-pcl queries are returning correct row count but all data is null or 0

Help Please. I am trying to learn xamarin c-sharp. To that end I have learned just enough of the basics that I felt confident trying to make a simple SQLite Db app. I am using sqlite-net-pcl. I have tried Xamarin.Android as well as Xamarin.Forms. I…
0
votes
0 answers

Using SQLite-net-pcl and can't update the data

So i have this really annoying problem where i Can't seem to get it to update any of the databases i have created, whats worse the i can see the instance is showing the updated information but isn't applying it. I'm really new to this and is my…
0
votes
1 answer

How can I read a `uuid` from a column in a sqlite3 db using sqlite-net-pcl in Xamarin Forms

I have a database schema that I do not control (it's a sqlite3 file exported from a desktop application that I need to interoperate with), that contains UUIDs for some of the columns. I'm using sqlite-net-pcl in a Xamarin.Forms app, and I cannot…
Graham Lee
  • 295
  • 4
  • 8
0
votes
1 answer

c# console application .netcore 3.0 sqlite-net-pcl | Unable to add rows

I am using: c# console application .netcore 3.0 sqlite-net-pcl and I am unable to add rows to a table from consecutive insert operations. If I step through a debug, the table will populate partially. foreach (Trivia t in…
0
votes
0 answers

Querying a list that has 16967 items returns null reference exceptions when no results

I have a list with 16967 items and when querying the list and no results are found instead of count = 0 or zero results it throws, "System.NullReferenceException: Object reference not set to an instance of an object" is throwing. var result =…
kiflay
  • 699
  • 2
  • 7
  • 14
0
votes
1 answer

SQLite.NET PCL returning 0 in all instances of autoincrement primary key

I am totally not getting this, because I have used this library in Xamarin apps for several years. I have this base class that contains properties common in all db items: public class BaseItem { [PrimaryKey, AutoIncrement] public int ID {…
John Ureke
  • 19
  • 5
0
votes
0 answers

How to do the CRUD operations for a table with a foreign key with SQLiteNet-Extensions

I am using sqlite-net-pcl with the SqLiteNetExtensions for a foreign key. I have this two tables ( not sure if they are written correctly) an agenda can contain many Tasks, my question is how do i write the CRUD methods to add/delete/load my tasks…
codejourney
  • 319
  • 4
  • 15
0
votes
0 answers

How to add/ load/ delete items from a foreign key table in xamarin forms with sqlite-net-pcl and sqliteExtensions

Hi i have this two tables ( not sure if they are written correctly) an agenda can contain many Tasks, my question is how do i write the methods to add/delete/load my tasks in my agenda, i am not sure how this work when you have a foreign key ?…
codejourney
  • 319
  • 4
  • 15
0
votes
1 answer

How to setup foreign key with sqlite-net-pcl in my xamarin forms project

after googling for a while, i haven't seen an example on how to create a table with a foreign key with the nuget sqlite-net-pcl for my xamarin.forms app. Let's say i have GroupTask.cs in which i storethe initial GroupTask: [Table("GroupTask")] …
codejourney
  • 319
  • 4
  • 15
0
votes
1 answer

Xamarin.Forms SQLite exception - don't know about PartsManagement.Models.Part[] (<- a custom class)

I am sorry for this re-post of a question, but the original was never answered in a way that I could understand and leverage. I was not certain if I should try to revive that question or spawn a new one. I am attempting to add a Part object to my…
5w3rv0
  • 7
  • 5
0
votes
0 answers

Sqlite net plc in Xamarin form: how do i commit the .db with async insert/update

I'm able to get the .db data and set into sqlite properties to query asynchronously. How do I go about in updating and inserting changes into the db afterwards? Do I have to make a synchronous database connection?
Joey
  • 93
  • 1
  • 9