Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Debugger Roadmap
Exception Assistant
 Troubleshooting Exceptions: System....

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual Studio Debugger
Troubleshooting Exceptions: System.Data.ConstraintException

A ConstraintException exception is thrown when an action is attempted that violates a constraint.

Relax or turn off constraints in your DataSets.

You can use the EnforceConstraints property to temporarily turn off constraints while filling tables in a DataSet object.

Make sure you are not trying to assign a value to a primary key field where the primary key already exists in the data table.

If the primary key exists, this exception is thrown.

Clear datasets before loading them from view state.

If there is data in the dataset when you load it, this exception may be thrown.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker