Row won't stay deleted

  • Thread starter Thread starter Timo
  • Start date Start date
T

Timo

I am deleting my row in this manner:

CurrentDataRowView.Delete()
CurrentDataRowView.Row.Table.AcceptChanges()


Is this way valid? The row is not being removed from the database
although it is being removed from the dataset. What else do I have to
do?

Thanks
 
Are you calling the DataAdapter.Update immediately after this?

YOu can also use DataRowFilterState and check for deleted
rows. It sounds like that's not the problem though b/c you
mention that it's deleting in the table.

If you are calling Update afterward, then I'd check the
Update Logic and make sure it works.

Can you post the rest of the snippet with the call to
update and the update command? I can probably be more
helpful if I can look at it.

Good Luck,

Bill

W.G. Ryan
(e-mail address removed)
www.knowdotnet.com
 
Hi,

You need to call the DataAdapters Update method before
you call Accept Changes. Accept Changes is really only
useful if you plan to work with the data in a
disconnected state and never make changes on the
database. Accept changes will change the rowstate and
therefore if you call data adapter's update method after
this it will find no rows in the modified state.

Thanks
 
Hi Neil. Update() calls AcceptChanges() (either implictly or explictly) ...

Derek LaZard
 
Back
Top