Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C++
empty
Posted
Updated 4-Apr-10 22:56pm
v8

The reason for this error:
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_locationToEmployee_Employees". The conflict occurred in database "TimeOutServices", table "dbo.Employees", column 'emp_id'.The statement has been terminated

While you are inserting data in locationToEmployee table, you are sending a value of 'employee_id' that actually does not exists in your employees table.

You have employee_id as a foreign key specified. Just check the value of @EmpId that you are supplying to your Stored procedure. That value must be missing in the Employee table. You can only pass those values for @EmpId that are present in employee table.
 
Share this answer
 
miltonraj wrote:
I will try ajax auto complete from database,if I run that program got a error "

You have changed the whole question now! You have to create a new question and not update the old one!

Kindly rollback your change and create a new question. At time of updates or doubts, you need to update the existing question. It's not like you can post only one question and keep on updating it with different ones over a period of time!

UPDATE: Rolledback your question to original one. Create a new one to post your new doubt.
 
Share this answer
 
v2

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