Click here to Skip to main content
13,053,026 members (61,356 online)
Rate this:
Please Sign up or sign in to vote.
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 6-Sep-12 20:39pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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..[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 7 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100