Hi all,
I'm developing an application for a hospital, but I'm having some trouble with my data-entry form...
I'll do my best to explain the situation in detail:
Basically I have 3 Tables:
Patient
Admission
Surgery
Patient can have one or many Admissions
During a single admission the patient can need one or many Surgeries
On my form I have 3 bindingsources with the tableadapters etc. (1 for each table)
The users who need to enter this data need to see all this as if it is 1 record ... all data-entry controls are on a single form
At the moment when I click "New" this is what should happen
- They select a patient
- PatientBindingSource.position = selected patient
- AdmissionBindingSource.Addnew()
- Fill in all the admission information
- Click "Add Surgery"
- SurgeryBindingsSource.Addnew()
- Fill in all the surgery information
- Save to database
I expected that when I perform "addnew" on a Child BindingSource the PK from the Parent Bindingsource would be set in the FK field from the child bindingsource...
But this clearly isn't the case... Anybody know how to do this??
Thanks in advance!
I'm developing an application for a hospital, but I'm having some trouble with my data-entry form...
I'll do my best to explain the situation in detail:
Basically I have 3 Tables:
Patient
Admission
Surgery
Patient can have one or many Admissions
During a single admission the patient can need one or many Surgeries
On my form I have 3 bindingsources with the tableadapters etc. (1 for each table)
The users who need to enter this data need to see all this as if it is 1 record ... all data-entry controls are on a single form
At the moment when I click "New" this is what should happen
- They select a patient
- PatientBindingSource.position = selected patient
- AdmissionBindingSource.Addnew()
- Fill in all the admission information
- Click "Add Surgery"
- SurgeryBindingsSource.Addnew()
- Fill in all the surgery information
- Save to database
I expected that when I perform "addnew" on a Child BindingSource the PK from the Parent Bindingsource would be set in the FK field from the child bindingsource...
But this clearly isn't the case... Anybody know how to do this??
Thanks in advance!