问题标签 [sqlite-net-pcl]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
forms - 在 Xamarin 表单 Android 项目中引用 sqlite-net-pcl 包时出错
当我尝试在表单项目sqlite-net-pcl的 Android 项目中引用包时,出现以下错误。Xamarin在发布模式下构建时出现此错误,但调试模式似乎很好。我在用
sqlite-net-pcl 1.4.118
Xamarin.Forms 2.4.0.282
Xamarin.Android.Support.* 25.4.0.2
xamarin - 安装 nuget 包后 Xamarin 应用程序崩溃
在 Visual Studio 2017 中,我创建了一个 Xamarin PCL 项目,该应用程序运行良好,但在安装了一个名为 sqlite-net-pcl 的 nuget 包后,它在启动时崩溃。我已经尝试安装它的其他版本,并尝试将构建从 111 更改为 259,但仍然没有运气。
c# - “SQLite.SQLiteConnection”的类型初始化器抛出异常
我正在尝试实现 SQLite 的一个非常基本的用法。我有一个Button和一个EditText。我想存储EditText OnClick.
我正在关注这个:https ://developer.xamarin.com/guides/android/application_fundamentals/data/part_3_using_sqlite_orm/
和https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/databases/
如果没有收到后续错误,我无法通过以下起始代码:var db = new SQLiteConnection (dbPath);
错误:
'SQLite.SQLiteConnection' 的类型初始化程序引发了异常。
内部异常:
System.Exception:这是“诱饵”。您可能需要将 SQLitePCLRaw.bundle_* nuget 包之一添加到您的平台项目中。
在 SQLitePCL.Batteries_V2.Init () [0x00000] 在 <9baed10c674b49e0b16322f238b8ecc1>:0 在 SQLite.SQLiteConnection..cctor () [0x00000] 在 /Users/vagrant/git/src/SQLite.cs:169 }
我已经在 PCL 和 Android 项目上安装了 NuGet 包。我看到安装了以下软件包:
我试过安装:
如前所述,代码是可能的最基本实现:
我花了几天时间尝试了许多资源,例如:https ://forums.xamarin.com/discussion/87289/sqlite-net-pcl-bait-issue但最终没有成功。
不幸的是,诸如“它只是有效”、“不确定我做了什么”、“清理/重建”之类的废话是我见过的唯一答案,例如以前的链接、其他 SO 帖子,如Xamarin SQLite “这是‘诱饵’”
这是我package.config的Android项目:
这是 PCL 项目的 package.config:
c# - 如何在 C# 中更新 SQLite 记录的属性?
我正在尝试在我的代码隐藏中更新SQLite记录的“大”属性。boolean我在共享项目中使用sqlite-net-pclNuget 包。Xamarin.Forms
我已经想出了如何将我的记录传递给我的方法,但我无法让属性更新。
当我运行它时,我没有收到任何错误,但没有任何反应。更新记录的正确语法是什么?很难找到关于这个主题的文档。
c# - SQlitedatabase 无法更新和删除行
我正在使用 Xamarin 表单,并且我已经使用 Sqlite-net-pcl nuget 包实现了 SQLite 数据库。问题是数据库最初保存了一行,但无法更新或删除任何行。这是我使用 Key 保存和删除数据库行的代码。
谁能指出我在这方面所做的错误,提前谢谢
c# - Xamarin sqlite-net-pcl 访问数据库内部的值
我正在使用 Visual Studio 2017,它是 SQLite 的新手,我无法理解如何访问保存在数据库中的值并将其返回到类的元素中。
到目前为止,通过 .xaml 页面输入数据没有任何问题,在 ListView 中选择对象也可以。
现在的问题是,我似乎找不到合适的方法将返回的 Task 转换回一个对象,以使用仅通过 HTTP 响应提供的数据更新其中一些值,而 HTTP 响应本身并不总是为数据表,例如,如果在第一个响应中成功,则只有 ID 和代码。然后它需要来自对象的其他数据并再次为对象的不同元素传递值,这就是为什么我想知道是否有某种方法可以将一行数据返回到临时对象以在数据库中更新它,如果需要,删除它(通过 HTTP 响应取消)或修改它。
android - 如何在 Xamarin Forms 中连接两个表?
这可能是一个愚蠢的问题,但我无法保存在 sqlite 中。我已成功使用 XF 的 facebook 登录,但也想将那里的信息保存在 sqlite-net-pcl 中。两种型号是:
我已成功将信息下载到我的 FacebookProfile 模型并可以显示它。但是,当我尝试将它保存在我的 sqlite 数据库中时,FacebookProfile 的 AgeRange 属性在数据库中保存为 null 并且它应该具有一定的值。使用 sqlite 连接保存的代码是:
此后,插入数据库的年龄范围保存为空,我不知道为什么或者我可能做错了什么。因此,当我尝试在视图模型中使用以下代码检索它时:
从数据库中检索到的 FacebookProfile 的年龄范围值为 null,但其他我可以获得正确的信息。可能是什么问题?请帮忙!
c# - Querying a table only returns null to a list in sqlite-net-pcl
so I've been trying a bit around sqlite-net-pcl and this just doesn't seem to be able to update the status... After trying around a bit with a teststring to somewhere localize the problem it starts with the first list which appears to be filled with 0's only so I've somewhat reverted it back to where it was.
No matter how many entries there are in my table, whenever there is either a 0 or a 1 in the object's status value it filled the list with another 0.
Question
Why is ObjectIDList always returning zeros even though I have many records in the database whose ObjectStatus = 0 or ObjectStatus = 1? If I have 5 records, then it returns 5 results but with zeros instead of the actual ObjectID.
xamarin - 使用 sqlite 创建表时如何避免包含 TypeInitializationException 的 AggregateException
在我的数据库 ctor 中:
数据库路径为 /data/user/0/com.companyname.AppName/files/fn.db3 (仅在此处过滤包名)
但是在创建表时会发生这种情况:未处理的异常:System.AggregateException:发生了一个或多个错误。
在 BO 中,我已经删除了 DateTime:目前只有 string 和 int 是应用的类型。
NuGet:
编辑:在AggregateExceptionis oneTypeInitializationException中,在创建表时发生。但是在调试时
SQLite.SQLiteConnection被表示为TypeName 。在代码中明确定义。是否缺少创建 db 文件的权限?TypeInitializationExceptionSQLiteAsyncConnection connection
sqlite - sqlite-net-pcl 库是否支持一对多或多对多关系 - Xamarin
我对 xamarin 表单完全陌生,我想与 sqlite-net-pcl 库创建一对多的关系。请帮我解决这个问题。