Questions tagged [microsoft.data.sqlite]

26 questions
5
votes
1 answer

.NET 5 excludes some libraries from single file publication

I have a little problem with single file executable publish with .NET 5. Infact, it does not include all libraries in the executable file, and produces multiple files. In my example I'm using a library for SQLite (Microsoft.Data.Sqlite) and, after…
devpelux
  • 2,492
  • 3
  • 18
  • 38
3
votes
1 answer

You specified a password in the connection string, but the native SQLite library you're using doesn't support encryption

I am facing an issue to set the Password attribute in the Sqlite connection string in Xamarin Forms Android application. It is working fine in Xamarin Forms iOS. I have used the following ` connection.ConnectionString = new…
2
votes
0 answers

Lifetime of a SqliteConnection

What is the recommended way of using a SqliteConnection object? We are using sqlite inside a console application and I'm wondering if we should use a single connection for the entire application lifetime or create a new connection each time we need…
1
vote
0 answers

Prevent SQLite from completely closing the connection (C#)

In a WPF app, I'm creating a connection to a local encrypted database (using Microsoft.Data.Sqlite): string builder = new SqliteConnectionStringBuilder($"Data Source=source.sqlite; Password='{password}';") { Mode =…
difilo9635
  • 19
  • 1
1
vote
1 answer

SQLite complains about null values in a column lacking a NOT NULL constraint

I'm getting a curious error when inserting a record into a SQLite table. This is from the logs of a customer: Microsoft.Data.Sqlite.SqliteException: SQLite Error 19: 'NOT NULL constraint failed: Events.details'. at…
Petter Hesselberg
  • 5,062
  • 2
  • 24
  • 42
1
vote
1 answer

Will SQLite fail to run if the Platform of my Winforms app is set to x86?

In the ValidationResult that I get when readying my app for submission to the Microsoft Store (which my app "PASSED WITH WARNINGS") , I got this "Fail" under the "Package Sanity Test" section of the report: I find this confusing, as it says both…
1
vote
1 answer

Open Encrypted Sqlite Database With Microsoft.Data.Sqlite Created By System.Data.Sqlite

I have a database that was created with a password using the System.Data.Sqlite package and the ChangePassword method. Is it possible to open this database using the Microsoft.Data.Sqlite package? I've tried using the sqlcipher package described…
MadSkeletor
  • 161
  • 1
  • 14
1
vote
0 answers

Use transaction to batch updates to SQLite

I get an error using Microsoft.Data.Sqlite to add products to a SQLite database in a loop. The error: Must add values for the following parameters: @ItemCode, @ItemCost, @ItemDescription, @LocationId, @ReorderStockLevel, @ReservedStockLevel,…
Vague
  • 2,198
  • 3
  • 18
  • 46
1
vote
1 answer

SQLite foreign key constraint failed using EF Core to add to child collection

An order is already inserted in the SQLite database using EF Core. Trying to add an order detail to that order as below, SaveChanges throws an exception SQLite Error 19: 'FOREIGN KEY constraint failed' Code: using (DataContext dbase = new()) { …
Vague
  • 2,198
  • 3
  • 18
  • 46
1
vote
2 answers

Ensuring exactly one SQLite connection per thread

I'm using Microsoft.Data.Sqlite.Core with SQLitePCLRaw.lib.e_sqlcipher to access an encrypted SQLite database. There are a few challenges I need to address: I must ensure that the same instance of Microsoft.Data.Sqlite.SqliteConnection is not…
vladek
  • 577
  • 1
  • 4
  • 17
1
vote
1 answer

Works on WPF. But on VSTO project, throws error: Could not load file or assembly 'SQLitePCLRaw.core, Version=2.0.2.669, Culture=neutral

I've created a .NET Standard 2.0 class library project that works fine when referenced by a WPF App (.NET Framework 4.8) project. But when the same library is referenced by a MS Office VSTO Project (also using .NET Framework 4.8), I get the…
nam
  • 21,967
  • 37
  • 158
  • 332
1
vote
0 answers

Why this C# code is inserting data into wrong column of SQLite table?

NOTE: Many thanks to user @David. The issue has been resolved. That was my mistake. Please see the UPDATE section below. Environment: Microsoft.Data.Sqlite, VS2019 v16.6.0, Windows10 Pro v1903 Question: why is the following code inserting the value…
nam
  • 21,967
  • 37
  • 158
  • 332
0
votes
2 answers

Using Mode=ReadWriteCreate doesn't create the database in some scenarios in Microsoft.Data.Sqlite

Currently, I am trying to completely delete an Sqlite database and recreating it if a database corruption is detected. However, when I: Create the database using Mode=ReadWriteCreate Delete it Recreate it again, same as step 1 The database file…
0
votes
1 answer

Eliminate "e_sqlite3.dll" during single file compilation

In my attempts to compile a single-file binary that leverages Microsoft.Data.Sqlite, I am consistently left with two files that are both required for the application to work. {ProjectName}.exe e_sqlite3.dll Is it possible to include the…
pim
  • 12,019
  • 6
  • 66
  • 69
0
votes
1 answer

Microsoft.Data.Sqlite - User defined aggregate window functions

I want to know if anybody successfully created an user defined aggregate window function for Sqlite by using Microsoft.Data.Sqlite C# package. I am not even sure if this is supported in the current incarnation of the package. Registering aggregate…
1
2