I have an application that uses an Access database and the database has a PATIENTS table and a DOCTORS table. Of course, the PATIENTS table has a foreign key relationship with the DOCTORS table to identify who the patients doctor is.
Now, when my application starts I'm pulling in the DOCTORS table using a TableAdapter and BindingSource (TableAdapter.Fill(BindingSource)) and I'm also pulling in the PATIENTS data but the patients data is coming in as a query that joins the doctor. This all works pretty good since I can view, add, and edit data.
Now, my problem is with deleting. If I add a brand new record to DOCTORS and then try to delete this record I get a message: "The record cannot be deleted or changed because table 'PATIENTS' includes related records."
Why do I get this message? I understand there is a relationship with these tables but there shouldn't be any related patient data for a brand new doctor.
Also, I am actually able to update a doctor record (change his name) but it is not reflected in the patient data unless I refill the binding source; is there a way for this to update automatically?