A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
forum regarding insert data
Joined: Sep 14, 2007
Sep 14, 2007 05:37:00
: [Microsoft][SQLServer 2000 Driver for
][SQLServer]The INSERT statement conflicted with the FOREIGN KEY constraint "FK_EmpDetails_Emp". The conflict occurred in database "itracker", table "dbo.Emp", column 'EmpId'.
how can i handle this exception
Joined: Apr 14, 2004
Sep 14, 2007 05:54:00
Make sure the data you insert doesn't conflict with your database constraints. My guess is you are inserting a record into the emp table that uses an empId that does not exist in empdetails?
I agree. Here's the link:
subject: forum regarding insert data
ResultSet is not updateable.
Insert Query with auto-incrementing key
Exception while trying to add a new user to the database
JDBC / SqlServer / MSDriver / executeBatch / no exception thrown
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014