Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello, I am getting this error while using linq concept in asp.net
SQL
The INSERT statement conflicted with the FOREIGN KEY constraint "cons_fk_offer_id". The conflict occurred in database "praveen1245", table "dbo.ADMIN_OFFERS", column 'offer_id'.
The statement has been terminated.
Posted
Updated 25-Aug-14 13:40pm
v2

Look at the database definition for the FOREIGN KEY constraint "cons_fk_offer_id".

Look at the column offer_id in your INSERT statement and determine why it does not comply with the FOREIGN KEY constraint. It probably is caused by the fact that the value for offer_id in your INSERT statement is not in the table referred to in the FOREIGN KEY constraint.
 
Share this answer
 
v3
That means the OfferID you are inserting in your table dbo.ADMIN_OFFERS does not exists in Primary Table.

If you have SQL Server Management Studio, open it up and sp_help 'dbo.ADMIN_OFFERS'. And check which column that FK is on, and which column of which table it references.

See The INSERT statement conflicted with the FOREIGN KEY constraint[^].


--Amy
 
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