calling a dataAdapter Update in DataTable.DataRowChanged Event

  • Thread starter Thread starter pplppp
  • Start date Start date
P

pplppp

At some part of my application I want to hide the idea of a cache
(dataset) from my user, so went the user deletes a row using the data
bound UI, which deletes the row from the corresponding data table, I
want to make a call to commit the changes to database as well, so what
I did is I registered an event handle for the DataRowChanged Event and
tried to call DataSet.GetChanges. The problem is DataSet.GetChanges
return null. Is is because the DataSet is still in edit mode when the
DataRowChange event fires? So how can I commit data at the same time
as it is deleted from the dataset apart from putting a separate
'commit' button?

thx in adavance
 
Hi.

I nearly had the same problem. It work's if you just call the Update method
of your DataAdapter.

You can do the same when the user deletes a Row - but if you trie to stop
the deletion based on some conditions, you really run into big troubles. (I
havn't solved them yet)

Benedikt
 
Back
Top