Reader Level:
ARTICLE

One or more rows contain values violating non-null, unique, or foreign-key constraints

On March 14, 2008 Articles | Error Zone
You may get this error when using a typed DataSet. This tip shows how to fix it.
  • 0
  • 0
  • 53310

The following error ususally occurs when your typed DataSet is confused about a key constraints.

  • "An error has occurred during report processing.
    • Exception has been thrown by the target of an invocation.
      • Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. "

To fix this problem, try to delete your typed DataSet and create again by dragging a table or SP direct on the Form from your Database.

If it does not solve your problem, open your Typed DataSet in designer by double clicking on .xsd file and delete the key contraints from the column.

Here are some more threads on this topic:

  1. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=364416&SiteID=1
  2. http://weblogs.asp.net/rosherove/archive/2004/10/03/DataSet-hell-_2D00_-_2200_Failed-to-enable-constraints.-One-or-more-rows--contain-values_2E002E002E002E002200_.aspx
  3. http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.adonet/topic14842.aspx
  4. http://www.dotnet247.com/247reference/msgs/21/108864.aspx

 

Mahesh Chand

Mahesh Chand is founder of C# Corner. C# Corner founded in 1999 is a FREE member contributions based open platform for developers to solve problems, learn new technology and hang out.  M...

  • 1rank
  • 71M readers
  • 9times
COMMENT USING

Trending up