Alex Rivera | Logout

What triggers ConstraintException when loading DataSet?

Asked 2008-09-26T15:18:13.160
36

How can I find out which column and value is violating the constraint? The exception message isn't helpful at all:

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

Edit
Report

1 Answer

12

There is a property called RowError you can check.

See http://dotnetdebug.net/2006/07/16/constraintexception-a-helpful-tip/

Edited to add this link showing iteration of rows to see which had errors.

http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.adonet/topic58812.aspx

answered 2008-09-26T15:27:01.437

Your Answer