By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,276 Members | 2,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,276 IT Pros & Developers. It's quick & easy.

Deleted Data Rows Behavior

P: n/a
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?
--
--Zorpie
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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
Nov 21 '05 #2

P: n/a
> 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
Nov 21 '05 #3

P: n/a
>
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
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.