forms - 您在连接字符串中指定了密码,但您使用的本机 SQLite 库不支持加密
问题描述
我在 Xamarin Forms Android 应用程序的 Sqlite 连接字符串中设置 Password 属性时遇到问题。它在 Xamarin Forms iOS 中运行良好。我使用了以下`
connection.ConnectionString = new SqliteConnectionStringBuilder(connection.ConnectionString)
{ Password = password }
.ToString();
connection.Open();
` 在此处输入图像描述 您在连接字符串中指定了密码,但您使用的本机 SQLite 库不支持加密。
我在我的 Xamarin Forms 应用程序上使用 Microsoft.Data.Sqlite 3.1.5 nuget 包。
任何帮助,将不胜感激。
解决方案
我知道稍后会回答这个问题,但答案可以帮助其他人快速获得解决方案。
在解决方案下方,因为Jason在上面有评论:
dotnet remove package Microsoft.Data.Sqlite
dotnet add package Microsoft.Data.Sqlite.Core
dotnet add package SQLitePCLRaw.bundle_e_sqlcipher
https://docs.microsoft.com/en-us/dotnet/standard/data/sqlite/encryption?tabs=netcore-cli
推荐阅读
- javascript - 如何循环访问数组中的本地存储对象或转换 JSON 中的数据
- css - 覆盖 Css 文件
- excel - 如何摆脱某些零公式?
- javascript - 当我执行 $yarn prod 时,来自 innerHTML 的图像未显示在 dist 文件夹中
- php - 如何限制 SQL 中的输入时间间隔?
- variables - 如何在不使用`n`r的情况下发送新行?没有输入
- c# - asp.net core中控制台应用和Web应用的区别
- c++ - 具有聚合初始化的 C++ 常量匿名实例
- uitapgesturerecognizer - tvOS Siri 遥控器:SKView UITapGestureRecognizer 不工作,但 UISwipeGestureRecognizer 工作正常
- php - 在 Laravel 中显示带有投票数信息的用户列表