Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Sir ,

I was getting Error When i saved button entered error displayed i.e :: Violation of PRIMARY KEY constraint 'PK__booking1__03317E3D'. Cannot insert duplicate key in object 'dbo.booking1'. The statement has been terminated.

Please ASAP reply with full solution .<b></b>
Posted

you are trying to insert a duplicate key where the key field is declared

as primary key.

check the primary key of the table and eliminate the insertion of the duplicate key
 
Share this answer
 
Dear Friend
I have a datatable that contain 5 records, These 4 records r also in the database here i m getting an error.Violation of PRIMARY KEY constraint 'PK_inventory'. Cannot insert duplicate key in object 'dbo.inventory'.
The statement has been terminated.
Regard
Priya
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900