Nishant Rambhojun
Nishant Rambhojun

Reputation: 77

Failing to insert new item in database(db.saveCHanges fails)

at the line db.SaveChanges(); of the execution. I get the following error.

Note: I am performing an insert.

enter image description here

ERROR :

Cannot insert duplicate key row in object 'dbo.ProductVariant' with unique index 'ProductVarioant_Barcode'.The statement has been terminated.

Upvotes: 0

Views: 178

Answers (1)

John
John

Reputation: 714

Error indicates that you are trying to insert a duplicate value inside Barcode column of ProductVariant table. While there is an unique constraint on ProductVariant.Barcode.

Upvotes: 1

Related Questions