Click here to Skip to main content
15,904,415 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I have one windows application and one web application through windows application inserting a quickbooks records to tables with the help of web application.

While running the application it is working fine and it strong the values into table but i created a setup for that windows application ,while running setup it is not storing the values in to table only one table values it storing, after that it will some exception like .
The INSERT statement conflicted with the FOREIGN KEY constraint "FK__CustomerP__Class__618671AF". The conflict occurred in database "FISOFTSP", table "dbo.CustomerPortal_ClassCode", column 'ClassID'.

what is the pls help me for this one ..
Advance thanks.
Posted

You are inserting wrong data.If the primary key column doesn't have this data , it is not going to accept it from insert statement. If you have SQL Server Management Studio, open it up and use sp_help to see which column that FK is on, and which column of which other table it references.

Also have a look on this..
http://social.msdn.microsoft.com/forums/en-US/transactsql/thread/0ba0501d-bc2e-4afc-824e-b75f18a8b491/[^]
 
Share this answer
 
Hello,
SQL
The error is pretty clear.

ClassID is in a foreign key relationship with another table, which does not contain the ID you are trying to insert. Insert the value in the dbo.CustomerPortal_ClassCode master table first, or check and correct the value you are inserting in ClassID in child table


Thanks!!!!!!!!!
 
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