M
MB
Hello!
I have a major question.
I have several tables in my SQL-DB with several relationships (without update/delete cascade) like for example:
- Customers
|
'- Contacts
If I in my vb project datagrid deletes a contact and the parent customer, the ds.update has to be made in the order daContacts.update(ds, "Contacts") and then daCustomers.update(ds, "Customers"), because you can't delete a parent row having a sub value in the child table.
If I in my vb project datagrid inserts a Customer and a Contact, the ds.update has to be made in the order daCustomers.update(ds, "Customers") and then daContacts.update(ds, "Contacts"), because you can't insert a contact that not belongs to a parent Customer.
Do I really have to take care of the order in which I call the update methods?
I also tried adding relationsships to my dataset in vb, but the problem almost reamains the same.
How should I do. Should I use update/delete cascade. I have learned to always only work with one table in each dataadapter. Is this correct? I think I've missed something.
Regards Magnus
I have a major question.
I have several tables in my SQL-DB with several relationships (without update/delete cascade) like for example:
- Customers
|
'- Contacts
If I in my vb project datagrid deletes a contact and the parent customer, the ds.update has to be made in the order daContacts.update(ds, "Contacts") and then daCustomers.update(ds, "Customers"), because you can't delete a parent row having a sub value in the child table.
If I in my vb project datagrid inserts a Customer and a Contact, the ds.update has to be made in the order daCustomers.update(ds, "Customers") and then daContacts.update(ds, "Contacts"), because you can't insert a contact that not belongs to a parent Customer.
Do I really have to take care of the order in which I call the update methods?
I also tried adding relationsships to my dataset in vb, but the problem almost reamains the same.
How should I do. Should I use update/delete cascade. I have learned to always only work with one table in each dataadapter. Is this correct? I think I've missed something.
Regards Magnus