Deleted Data Rows Behavior

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

Guest

Is this true:

An existing row in a data table that is deleted still exists in the rows
collection, but it is marked as deleted (rowstate = deleted)

But

If a row that was added to the data table, but not committed by accepting
changes, is then deleted, it is actually removed from the data table's rows
collection?
 
Zorpiedoman,

"Remove" from a datarow means that a datarow is directly completely removed.

Delete checks the datarowstate from a datarow.
If it is newly "Added" than it follows the rules of Remove
In other situations it gets a datarowstate "Deleted"

If you call acceptchanges, than the rows with "Deleted" are removed and the
other ones get the rowstate "Unchanged".

If you Fill a dataset than the rowstates are automaticly set to "Unchanged",
this you can change by setting the property "AcceptChangesDuringFill".

The same acceptchanges is done by a complet correct done DataAdapter update.

I hope this helps,

Cor
 
If you call acceptchanges, than the rows with "Deleted" are removed and the
other ones get the rowstate "Unchanged".

I find this hard to belive because if have a row, delete it, and accept
changes it must still be there somewhere for the data adapter to reference to
send back a deletecommand when up link up and update with the server, right?

-zorpie
 
I find this hard to belive because if have a row, delete it, and accept
changes it must still be there somewhere for the data adapter to reference
to
send back a deletecommand when up link up and update with the server,
right?

No it is not, acceptchanges can you as well write as, acceptchanges as if
you have all updated those.

By instance in this kind instructions

If ds.haschanges
dataAdpater.Update(ds.getchanges)
ds.acceptchanges
End if

The 'ds.getchanges' is a copy of the dataset, therefore you have to accept
all changes in the original dataset as well and remove than all deleted
rows.

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top