constraintexception

Handling XSD Dataset ConstraintExceptions

Does anyone have any tips for dealing with ConstraintExceptions thrown by XSD datasets? This is the exception with the cryptic message: System.Data.ConstraintException : Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. ...

ConstraintException on insert into primary key

I had a typed dataset with three tables in master-detail relationships and got the error "Failed to enable constraints. One or more rows contain values ciolating non-null, unique or foreign-key constraints." I couldn't figure out where the issue came from and finally simplified tho whole thing to this: New typed dataset containing one ...

Handle ConstraintException and get ColumnName that cause the error

Hello, I have a Table Machines that made of: ID = Identity , Primary , AutoIncrement,NOT NULL SN = Unique , String , NOT NULL Name =String now I am using a form to insert data into this table, and I am using BindingSource and ErrorProvider, I am handling Null and Empty string in the DataSet layer (partial class in the dataset.xsd), no...

ConstraintException when filling a DataGridView from a SQL Server view

Hi all, I have a SQL Server view which does a simple join of two tables and returns some of the columns. Running this view in Management Studio does not cause any problems, the expected data (two rows) is returned. When I use this view as data source for my TableAdapter in Visual Studio, I get a ConstraintException saying "Failed to en...