updating dataset using join and bindingsource?

Posted by netadictos on Stack Overflow See other posts from Stack Overflow or by netadictos
Published on 2009-08-06T09:36:15Z Indexed on 2010/05/09 6:08 UTC
Read the original article Hit count: 262

Filed under:
|
|

Hi,

I have created a dataset and in the designer I have created the relations and foreign keys that exist in the database. Basically, I have a product that has a relationship to a table of prices. The keyfield they share is IdProduct in the Prices table. In the Fill/Get of the product I return the Price field.

I also have a DataGrid that uses a BindingSource which uses this 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 record selected.
The user at this point is able to make changes to the record and they are properly propogated back to the BindingSource. The problem is that the TableAdapter does not contain the appopriate update, therefore I am not able to call the TableAdapter.Update method with the dataset as I would had I created a tableadapter not using a join.

How am I best to handle this situation.

At the same time I cannot get any modified row:

       dTiendasDs.ProductosDataTable modified = (dTiendasDs.ProductosDataTable)
dTiendasDs.Productos.GetChanges(DataRowState.Modified);

modified is always null

Thanks,

© Stack Overflow or respective owner

Related posts about .NET

Related posts about databinding