无法启用约束。一行或多行包含违反非空,唯一或外键约束的值。

问题描述:

请帮助,我一直在试图修复这个错误为更好的部分8小时到目前为止。我在Crystal Reports中有一个刚刚开始抛出此错误的报告。我更改了附加到报表的视图中的一个字段,所以我在VS2010中打开了我的XSD文件,并将当前的DT重命名为ViewTracker0,然后拉入ViewTracker视图。我添加了来自旧DT的查询,确保没有主键,双重检查每个字段长度与db相同,检查以确保每个列名称命名为与数据库匹配。我可以在XSD中预览我的数据,以及在SQL中我可以运行我的查询,一切正确返回。当我运行我的报告时,它每次都会出现此错误。

Please help, I have been trying to fix this error for the better part of 8 hours so far. I have a report in Crystal Reports that just started throwing this error. I changed a field in the View that is attached to the report, so I opened up my XSD file in VS2010 and renamed the current DT to ViewTracker0 and then pulled in the ViewTracker view. I added my queries from the old DT, ensured that there is no primary key, double checked that each length of the fields were the same as the db, checked to make sure that each column name is named to match the DB. I can preview my data fine in the XSD, as well as in SQL I can run my queries and everything is returned correctly. When I run my report, it dies everytime with this error.


无法启用约束。一行或多行包含违反非空,唯一或外键约束的值。

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

我需要检查下一步。

您是否已尝试在Crystal Reports设计器中验证数据库,然后运行报告?

Have you tried verifying the database within the Crystal Reports designer, then running the report?