gpt4 book ai didi

c# - Azure 离线同步。无法添加项目 "Query execution failed with result: ' MISMATCH'。”

转载 作者:行者123 更新时间:2023-12-03 01:50:29 29 4
gpt4 key购买 nike

我目前正在编写一个应用程序,我想向本地 SQLLite 数据库添加一个新项目:

        public async Task SaveTaskAsync(Fault item)
{
try
{
if (item.Id == null)
{
await FaultTable.InsertAsync(item);
}
else
{
await FaultTable.UpdateAsync(item);
}
}
catch (Exception ex)
{

}
}

但是语句 await FaultTable.InsertAsync(item); 最终出现以下错误:

“Microsoft.WindowsAzure.MobileServices.Sync.MobileServiceLocalStoreException:无法在本地存储上执行操作。”

内部异常:“SQLitePCL.SQLiteException 查询执行失败,结果:'MISMATCH'。”

内部异常的堆栈跟踪:

  at Microsoft.WindowsAzure.MobileServices.SQLiteStore.MobileServiceSQLiteStore.ValidateResult (SQLiteResult result) [0x00023] in <filename unknown>:0 
at Microsoft.WindowsAzure.MobileServices.SQLiteStore.MobileServiceSQLiteStore.ExecuteNonQuery (System.String sql, IDictionary`2 parameters) [0x00057] in <filename unknown>:0
at Microsoft.WindowsAzure.MobileServices.SQLiteStore.MobileServiceSQLiteStore.BatchInsert (System.String tableName, IEnumerable`1 items, System.Collections.Generic.List`1 columns) [0x000f5] in <filename unknown>:0
at Microsoft.WindowsAzure.MobileServices.SQLiteStore.MobileServiceSQLiteStore+<>c__DisplayClass10_0.<UpsertAsyncInternal>b__0 (System.Threading.Tasks.Task t) [0x00058] in <filename unknown>:0
at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke () [0x00027] in /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs:63
at System.Threading.Tasks.Task.Execute () [0x00016] in /Users/builder/data/lanes/2923/52635947/source/mono/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2502

最佳答案

MISMATCH 表示 SQL 语句(从模型生成)正在尝试插入与数据库中存储的表架构不匹配的数据。你最近换过型号吗?如果是这样,您将需要修复数据库。您可以在幕后(使用 SQLite 编辑器)或通过清除数据库然后重新同步数据。

关于c# - Azure 离线同步。无法添加项目 "Query execution failed with result: ' MISMATCH'。”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38616049/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com