all groups > visual studio .net general > august 2006 >
You're in the

visual studio .net general

group:

Updating multiple Tables via a BindingSource that uses a Join!


Updating multiple Tables via a BindingSource that uses a Join! Rob Dob
8/29/2006 3:29:53 PM
visual studio .net general: Hi,
I have both a Customer and a Orders Table, the key field is CustomerID. I
also have a DataGridView that uses a BindingSource created using a join
between the Customers table and the Orders table. Everything displays
correctly and when I double click on a row within the datagrid I then open
up a tabbed form that contains a detailed view of the bindingsource record
selected ( which was created using a join ). The user at this point is able
to make changes to the databound controls and they are properly propogated
back to the BindingSource. The problem is that the becuase I created the
TableAdapter using a join an appropriate update, insert, delete method was
never created. I need to be able to post back updates to both the Orders
Table and the Customer Table.



Any help, suggestions would be greatly appreciated

Thanks

Re: Updating multiple Tables via a BindingSource that uses a Join! cjard
9/5/2006 6:52:14 AM
Write an updatable join, and write the update query yourself..

Or do it using 2 separate Update commands, or even 2 separate
datatables and a datarelation.

Of the approaches, I favour NOT making datatables out of sql joins if
they are to be updated.. make 2 separate tables and update the records
in a transaction.


[quoted text, click to view]
AddThis Social Bookmark Button