[英]Azure Offline Sync. Can't add item “Query execution failed with result: 'MISMATCH'.”
I am programming an app currently i want to add a new item to the local SQLLite Database: 我目前正在编程一个应用程序,我想向本地SQLLite数据库添加一个新项:
public async Task SaveTaskAsync(Fault item)
{
try
{
if (item.Id == null)
{
await FaultTable.InsertAsync(item);
}
else
{
await FaultTable.UpdateAsync(item);
}
}
catch (Exception ex)
{
}
}
But the Statement await FaultTable.InsertAsync(item);
但是该语句
await FaultTable.InsertAsync(item);
is ending up with following error: 最终出现以下错误:
"Microsoft.WindowsAzure.MobileServices.Sync.MobileServiceLocalStoreException: Failed to perform operation on local store." “ Microsoft.WindowsAzure.MobileServices.Sync.MobileServiceLocalStoreException:无法在本地存储上执行操作。”
Inner Exception: "SQLitePCL.SQLiteException Query execution failed with result: 'MISMATCH'." 内部异常:“ SQLitePCL.SQLiteException查询执行失败,结果为:'MISMATCH'。”
Stacktrace of Inner Exception: 内部异常的Stacktrace:
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 indicates that the SQL statement (that is generated from the model) is trying to insert data that does not match the schema of the table stored in the database. MISMATCH指示SQL语句(从模型生成)正在尝试插入与数据库中存储的表的模式不匹配的数据。 Did you change the model recently?
您最近更改过模型吗? If so, you will need to fix the database.
如果是这样,您将需要修复数据库。 You can do that either under the covers (by using a SQLite editor) or by wiping out the database and then re-syncing the data.
您可以在后台进行操作(使用SQLite编辑器),也可以清除数据库,然后重新同步数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.