I have C# application (targeting .NET Framework) and I try to set a password on my (completely new) SQLite database.
This is my code
using System;
using System.Data.SQLite;
namespace ConsoleApp10
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Begin");
var csWithoutPw = new SQLiteConnectionStringBuilder
{
DataSource = "C:\\Databases\\SQLiteWithEFPw.db",
Version = 3
}.ConnectionString;
SQLiteConnection conn = new System.Data.SQLite.SQLiteConnection(csWithoutPw);
conn.Open();
conn.ChangePassword("Kabouter");
conn.Close();
Console.WriteLine("End");
}
}
}
This is my csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net462</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SQLite" Version="3.13.0" />
<PackageReference Include="Stub.System.Data.SQLite.SEE" Version="1.0.115.6" />
<PackageReference Include="System.Data.SQLite" Version="1.0.115.5" />
<PackageReference Include="System.Data.SQLite.Linq" Version="1.0.115.5" />
</ItemGroup>
</Project>
Unfortunately, my code crashes when connecting with a NotSupportedException
referring to some certificate issue I do not understand.
'{cannot find a suitable package certificate file for plugin in "C:\Users\dacohen\source\repos\ConsoleApp10\ConsoleApp10\bin\Debug\net462\SDS-SEE.exml" : "invalid file name"} {}'
How can I avoid this problem? I just want to set the password..... I found code online but for .NET Framwork 4.6.2 it does not seem to work or so.
In addition, this is why I set my password before opening.