479 questions
1
vote
0
answers
67
views
Microsoft.EntityFrameworkCore.Sqlite TOP and LIMIT SQL syntax error
In Entity Framework Core 9.0.9, the query builder fails with SQLite Syntax
builder.Services.AddDbContext<MyDbContext>(fun options ->
options.UseSqlite(connectionString) |> ignore
It ...
0
votes
1
answer
86
views
How do I populate SQLite-net database with a base set of data?
I am very new to all of this (coding in general, C#, .NET MAUI, MVVM practices, SQLite) so excuse me if my inexperience shows.
The context
I have an app that has a database with a table Cars.
To make ...
0
votes
0
answers
82
views
Unable to run SQLite-net on Mac catalyst in release mode, works fine in debug
I have a UNO platform application that is trying to use SQLite-net-pcl. While this seems to work fine in iOS in release mode in MacCatalyst in release mode i get the following error
I am trying to ...
0
votes
0
answers
35
views
How can I force my own app to release a lock over its SQLite DB file?
I am working on a MAUI application which uses sqlite-net-pcl as its ORM. When I try to delete the DB file from the app (System.IO.File.Delete(dbFilePath)) I get the following exception on Windows: ...
3
votes
1
answer
805
views
.NET MAUI Entity Framework Core migration Issue when add new Tables and Rename
Here is necessary code segments in my program. My .NET project is .NET MAUI multiproject application. It has different projects for different platforms; WinUI, iOS, Maccatalyst, and Android too.
I'm ...
0
votes
2
answers
204
views
How do I delete records from one table that are linked to another table through its PK?
I have a database in a Maui app that has two tables. The first table was setup with a class like this:
public class Groups
{
[PrimaryKey, AutoIncrement]
public long Id { get; set; }
public ...
0
votes
0
answers
70
views
Sqlite is not saving new items after POST Request through ASP.NET Core
I've configured the ASP.NET Core Web API using controller to use Sqlite as the database, and after the request of adding new item, the item is not being saved to the database.
The POST request ...
0
votes
0
answers
283
views
Trying to use Query<> command sqlite c# using sqlite-net-pcl but it doesn't run
I have the following method which is inside a database context class for a .NET MAUI project. I have tested the SQL query in a DBMS without an error, so know it should be working. Using Debug....
0
votes
2
answers
618
views
SQLite Exception on .net MAUI : no such table: matches
I'm trying to create a counter for a card game, and I'm trying to store the "Matches" with the points on a Database. I have installed the nuget package sqlite-net-pcl, and I'm getting the ...
1
vote
1
answer
233
views
Sqlite's [Ignore] not working with CommunityToolkit.Mvvm's [ObservableProperty]
I have a field in my Model that I want to [Ignore] during SqliteConnection.CreateTable<myModel> but I also use the CommunityToolkit.Mvvm [ObservableProperty] and this is causing an error for ...
0
votes
0
answers
273
views
Conflict between .NET Maui permissions and sqlite-net-pcl?
I am an amateur, trying to write an app that uses a sqlite database. I want the app to have read/write access to the Documents folder on my Android phone. However, I am having trouble with read/write ...
1
vote
1
answer
89
views
SQLite Expression Function with Trim raises an error
I have a database created with SQLite in my C# project. In a function, I like to filter the record in a table using Linq. For this reason, using this code for the And function, I wrote
Expression<...
0
votes
0
answers
113
views
SQLite several tables with same data type?
Currently when I insert a new object in my database, it goes to the same table based on the data type.
For example:
sqlDatabase.Insert(myObject); // -> goes to MyObject table.
Is it possible to ...
1
vote
0
answers
430
views
How can I fetch data to dynamic List of Table in Maui from Sqlite Database?
I want to fetch data from SQLite database in Maui using raw Query. But while trying this function I am getting error:
>{System.ArgumentNullException: Value cannot be null. (Parameter 'type')
at ...
2
votes
4
answers
1k
views
SQLite cannot apply aggregate operator 'Sum' on expressions of type 'decimal'. Using LINQ to Objects to aggregate the results on the client side
Running the following code, there is an error in the OrdersPrice=g. Sum (p=>p.TotalPrice) line, Why?
I want to query the sales data of the corresponding Managers for Orders within the past month, ...
0
votes
1
answer
95
views
SQLite3 opens a file that is not a real database - why?
Using SQLite3 v3.41.0.
Rename any random file that is NOT a SQLite3 database as C:\Tmp\NoDatabase.db. In the sqlite3.exe command-line program run:
.open C:\\Tmp\\NoDatabase.db
No error occurs. Then ...
0
votes
1
answer
63
views
Clubbing multiple sqlite statements in a single query
I have a following table:
folderId
folderPath
1
"C:\Users\obama"
2
"C:\Users\biden"
Here, folderId is an autoincrement key.
Now, insertion into the table has following steps:
a)...
0
votes
1
answer
665
views
.NET MAUI - SQLite-net-PCL CreateTableAsync breaks
I previously had this issue where my whole application froze after calling db.CreateTableAsync in a Service.cs file after following this tutorial. After fixing this issue with this solution, the ...
1
vote
0
answers
765
views
.NET MAUI Application hangs on CreateTableAsync
I have been following this tutorial to implement SQLite-net into my MAUI application. Whenever the program executes "await db.CreateTableAsync<Restroom>();", the whole application ...
0
votes
1
answer
747
views
MAUI SQLite-net default value for datetime columns
I believe there is a bug in MAUI SQLite-net default value for datetime columns.
I did the following code:
db.Execute ("CREATE TABLE User (user_id INTEGER PRIMARY KEY AUTOINCREMENT,user_created ...
0
votes
1
answer
47
views
Select from 2 tables with count()
Dictionary table:
ID
Name
1
English
2
Italian
Word table references DictionaryID:
ID
DictionaryId
Word
1
1
A
2
1
B
3
2
C
I want to achieve a single query with a left join between Dictionary and Word ...
0
votes
1
answer
132
views
No result with sqlite-net-pcl, xamarin at ios only
I am trying to use sqlite on Xamarin and has been implemented sqlite-net-pcl to create and access local database. Works very well on Android but I can't read records on iOS.
...
1
vote
1
answer
201
views
SQLite database backup ASP.NET Core file locked
I have an ASP.NET Core 6 application that uses SQLite. I have a recurring Hangfire job that I'd like to use to back up the database using the online backup API of SQLite. Finally, I'd like to upload ...
1
vote
1
answer
565
views
.Net 4.8 Winforms Application | SQLite-PCL | Exception Info: System.TypeInitializationException | Why?
I'm using the sqlite-net-pcl nuget package (version 1.8.116) in a .Net framework 4.8 Winforms Application. It seems to have a .NET Standard dependency.
When running from the Visual Studio environment, ...
3
votes
0
answers
613
views
SQLite Database editor for App Development
I am working with a SQLite3 Database in my .NET MAUI App. The App is running on Pixel 5 - API 33 (Android 13.0 - API 33)-Emulator right now.
Right now, I am doing my SELCT-Statements to verify my ...
2
votes
0
answers
261
views
Can't get case-insensitive searches on SQLite
Using SQLite I'm trying to do a case-insensitive search on a string column, however it's only returning results when the case matches the column exactly.
The connection is setup as:
new ...
0
votes
1
answer
187
views
How To Read and Write Records In SQLite Using SQLite Net Extensions?
Here is the documentation I've looked at and may be helpful: Sample SQLite OneToMany Unit Test and General Read and Write Documentation in Readme
My use-case is that I've already inserted an Item and ...
1
vote
0
answers
178
views
Xamarin Forms Android release build crashes when downloaded from play store but not when manually installed on the phone from PC
I created a new release build for my Xamarin Forms Android App. I tried this both in aab format and apk the issue is the same. If I install the created release apk on my phone via USB transfer the app ...
0
votes
1
answer
228
views
MenuItem is not working in Android - Xamarin C#
As you can see, menu item is working properly in iOS but it's not working in android. this is my code and output :
code :
<?xml version="1.0" encoding="UTF-8" ?>
<...
0
votes
1
answer
1k
views
SQLite-NET-PCL Stuck on CreateTableAsync<Type>()
I'm working on a Xamarin mobile app using .NET Framework, and SQLite.NET-PCL. My XAML Form uses MVVM architecture, on my main form I am attempting to display all movies in a ListView, first I made ...
5
votes
3
answers
4k
views
Where to put database initialisation code in Maui App
I have created a .net standard class library service for accessing a sqlite database in my new Maui app. My question is where to call the initialisation code. I've added the DI registration in ...
0
votes
2
answers
248
views
Unable to Export Sqlite database from SpecialFolder.ApplicationData to SD Card Xamarin Forms
I am currently developing an app that uses the sqlite-net database. I am trying to copy/export the database to my SD Card. When I run the code I get a System.NullRefrenceException: 'Object reference ...
0
votes
0
answers
606
views
Writing a generic CRUD method that works regardless of type
I have an SQLite database and 5 classes/data-types (for this example I'm only going to use two of them: expense and category) and a DatabaseService that takes care of adding, deleting, updating and ...
2
votes
3
answers
2k
views
sqlite3_soft_heap_limit64 in type SQLitePCL.SQLite3Provider_dynamic_cdecl does not have an implementation
I am using the sqlite-net-pcl library in conjunction with Microsoft.Data.Sqlite.Core. It contains all the necessary libraries, but when you run this code:
this is what happens:
Method '...
1
vote
1
answer
41
views
Log4Net is writing "Invalid Date" to logs in Australia
For security reasons, we are not allowed to have our log4net use any external config files (like app.config), so everything has to be coded internally.
We are using log4net to write logs to an SQLite ...
0
votes
0
answers
142
views
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 ...
0
votes
1
answer
191
views
Xamarin Forms save the state of a switch on a prebuilt sqlite database
Ok so my app has a mini problem that I don't know how to save the state of a switch with my prebuilt database (the point is to have a lost of objects and the user can click the switch to mark that ...
0
votes
1
answer
111
views
How do i make a button read the text(url) stored in the database so it runs the xamarin essentials share function
Ok so i followed a few tutorials to make it so my app can read a database file and used this https://github.com/jfversluis/ExistingSQLiteDbSample
And it did work for me, but now what I'm trying to do ...
0
votes
1
answer
2k
views
Sqlite sync and async together
Is it good practice to use sqlite sync and async together.
Example i need on create method to use sqlite sync but in other thread to update another table async.
public class DatabaseHelper
{
...
2
votes
0
answers
797
views
SQLite schema based on SQL Server DB schema
I maintain a Windows based application backed by SQL Server DB so there is a set of SQL entities, like tables, views. With time I add new features and fix bugs so schema of the tables and views ...
0
votes
1
answer
392
views
How do I Sum a List from SQLite database
I'm trying to print the sum of the score numbers from the database to Label, but I can't get it up and running.
I use Entry as input for the score and names and then a button function to store them ...
0
votes
1
answer
974
views
How do I UnitTest with In Memory DB a stored procedure?
I am using SQLite InMemory DB to test my app, with Entity Framework Core and when I execute some queries like (select * from Users).
But when I try to do a stored procedure call dbo.GET_ALL_USERS"...
10
votes
2
answers
4k
views
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 ...
3
votes
2
answers
1k
views
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 ...
0
votes
0
answers
102
views
Using custom methods with SQlite.NET Filter predicates
We are using SQLite.NET (1.5.231) in a Xamarin project
We execute Get queries like this
var result = await db.Table<T>().Where(query).ToListAsync();
Where db is a SQLiteAsyncConnection and ...
1
vote
1
answer
265
views
How do I upload images to the SQLite database, via a dialog box, and output the image to XAML?
private void Button_Foto_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog openFile = new OpenFileDialog();// создаем диалоговое окно
openFile.ShowDialog();// ...
3
votes
1
answer
3k
views
SqliteException (0x80004005): SQLite Error 6: database table is locked - in-memory database with one writer thread and many query threads
I have a .NET server application running on RHEL (don't ask...) using SQLite as an in-memory database.
A single writer thread is updating a bunch of tables using an explicit transaction with external ...
0
votes
0
answers
149
views
How to connect Entity Framework 6 with SQLite database
Facing Some Issues to connect Entity Framework 6 with SQLite database can someone help please
0
votes
1
answer
453
views
Generic class method using SQLite-Net
I am trying to write a generic method to get the data from tables.
I am using sqlite-net ORM.
My methods compile well for delete:
public bool DeleteItem<T>(T NewItem)
{
SQLiteConnection conn ...
0
votes
1
answer
268
views
How to connect sqlite in xamarin
I am trying to connect to the DB(SQlite) but I keep on getting an error.
System.TypeLoadException: 'Could not resolve type with token 01000150 from typeref (expected class 'SQLite.CreateTableResult' ...