Updating a master table calls AcceptChanges on related detail table, how is it possible?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I've two tables: one master and the other is detail

I've this two lines

daNoleggi.Update(_ds.GH_Noleggi
daDettaglio.Update(_ds.GH_DettaglioNoleggio

When I add a line in GH_DettaglioNoleggio its state is "Added". After this line: daNoleggi.Update(_ds.GH_Noleggi
the state of the line in GH_DettaglioNoleggio is unchanged, then it's not saved in database

How is it possible this thing

Thanks for your help.
 
Hi,

When you call Update for the _ds.GH_Noleggi DataTable it does not mean that
than another DataTable will be updated automatically. If you need to update
both tables in one shot, then you need to call DataAdapter for the whole
dataSet not for the individual dataTable
 
When you call Update for the _ds.GH_Noleggi DataTable it does not mean tha
than another DataTable will be updated automatically. If you need to updat
both tables in one shot, then you need to call DataAdapter for the whol
dataSet not for the individual dataTable

I've not explained myself...

I don't want this thing to happen. When I update the first table, ADO.Net automatically change all the rowstate of the second table's rows are set to "Unchanged", so they will not be saved when I call _ds.Details.Update

Have you understand me now

Thanks for your help.
 
Back
Top