保存时出错 [英] error while saving

查看:102
本文介绍了保存时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

当我在程序中单击保存按钮时,我看到此错误:

when I click on the save button in my program I see this error:

System.Data.SQLite.dll中发生了类型为'System.Data.SQLite.SQLiteException'的未处理异常

附加信息:约束失败

NOT NULL约束失败:GoodsDeclaration.id

An unhandled exception of type 'System.Data.SQLite.SQLiteException' occurred in System.Data.SQLite.dll

Additional information: constraint failed

NOT NULL constraint failed: GoodsDeclaration.id

推荐答案

从您显示的少量信息中,我会说错误消息是不言自明的.显然有一个GoodsDeclaration.id字段,可能是数据表的主键,它在数据库端设置了NOT NULL约束,但尚未 初始化为非null值,可能是整数值.

From the little information you showed I would say the error message is kind of self-explanatory. There is apparently a GoodsDeclaration.id field, likely a Primary Key of a datatable, that has a NOT NULL constraint set on database side and that has not been initialized with a not null value, likely an integer value.

调试源代码,然后查看该字段的值在哪里设置.

Debug your source code and look at where the value for that field gets set.

wizend


这篇关于保存时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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