简体   繁体   English

Azure脱机同步。 无法添加项目“查询执行失败,结果:'MISMATCH'。”

[英]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.

相关问题 我无法重试 Azure 服务总线主题中的失败项目 - I can't retry failed item in Azure Service Bus topic Azure脱机同步-如何使用“包含” - Azure Offline Sync - How to use “Contains” Azure移动应用程序脱机同步 - 不同的用户 - Azure Mobile App Offline Sync - different users Azure Offline Sync是否处理关系表? - Does Azure Offline Sync deals with relational tables? Azure移动应用程序与自定义控制器脱机同步 - Azure mobile app offline sync with custom controller 无法将WHERE与Azure Mobile Offline Sync一起使用 - Unable to use WHERE with Azure Mobile Offline Sync 是否可以将Azure脱机同步与.Net Core一起使用 - Is it possible to use the Azure Offline Sync with .Net Core 同步。 两个多选列表框的SelectedIndex - Sync. SelectedIndex of two multiselect Listboxes Azure At Offline Offline Sync Updated At在增量同步期间提取整个数据 - Azure Offline Sync Updated At pulls whole data during the Incremental Sync NexusDB: <unnamed TnxODBCQuery instance> :查询执行失败:在行比较时键入不匹配(nxtInterval &lt;&gt; nxtNullString) - NexusDB: <unnamed TnxODBCQuery instance>: Query execution failed: Type mismatch (nxtInterval <> nxtNullString) when comparing at line
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM