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

◇◆丶佛笑我妖孽 提交于 2020-01-17 04:00:06

问题


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.

What do I need to check next.


回答1:


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




回答2:


Try traversing GetErrors(), described here: http://www.fransson.net/blog/failed-to-enable-constraints-one-or-more-rows-contain-values-violating-non-null-unique-or-foreign-key-constraints/



来源:https://stackoverflow.com/questions/8331463/failed-to-enable-constraints-one-or-more-rows-contain-values-violating-non-null

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!