应用插入时,无法将值NULL插入列中 [英] Cannot insert the value NULL into column when applying inserts

查看:154
本文介绍了应用插入时,无法将值NULL插入列中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在与Filter同步时,我遇到了冲突错误,即

While synchronization with a Filter, I got a conflict error, which is 

无法将值NULL插入"Name"列,表'XXXX';列不允许空值。 UPDATE失败。

语句已被终止。

Cannot insert the value NULL into column 'Name', table 'XXXX'; column does not allow nulls. UPDATE fails.
The statement has been terminated.

在表'XXXX'中,列'Name'在两侧都有一个字符串(本地数据库和远程数据库) DB)。

In table 'XXXX', the column 'Name' has a string in both sides (local DB and remote DB).

我想知道syncFx尝试做什么动作。

I want to know which action syncFx tried to do.

在调试模式下,我可以看到异常的冲突,但是我能看到的是表名,列名及其原因。

In debug mode, I can see the conflict from the exception, but what I can see are the Table name, column name, its reason.

但我想知道为什么syncFx试图这样做,因为'Name'字段没有空字段数据在我的数据库中。

But I want to know why syncFx tried to do so because there is no null-field data for 'Name' field in my DBs.

推荐答案

如果您订阅了ApplyChangeFailed事件,则event参数具有Conflict属性,而Conflict属性具有与正在处理的表(RemoteChange和LocalChange)对应的DataTable。这些数据表将具有冲突的
行。 

if you subscribe to the ApplyChangeFailed event, the event parameter has a Conflict property and the Conflict property has a DataTable that corresponds to the table being processed (RemoteChange and LocalChange). Those datatables will have the conflicting rows. 

在您的情况下不是冲突而是SQL错误。 

in your case that is not a conflict but a SQL error. 

您可以检查表格的SelectChanges存储过程并查看该列是否包含在内?

can you check the SelectChanges stored  procedure for the table and see if that column is included?


这篇关于应用插入时,无法将值NULL插入列中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆