do you get this error when adding a row or updating a row.
basically the error is telling you that a foreign key restraint you have specified in the database is causing the operation to fail.
I generally dont add foreign keys to the database and code the application to handle them instead.