RowState Quirk?

D

dm_dal

I'm noticing that when I update a row in my DataSet, the child/sibling rows
are also getting their rowstate changed to Modified. Is this the way it's
supposed to work? Sounds strange to me.

Example:
myDataSet contains three tables (t_parent, t_child1, t_child2) both child
tables are children of the parent as set in the Relationships in the
DataSet. Let's say each table contains 2000 related rows. If I update a
non-primary key field in t_parent, it's rowstate is set to modified.
However it's also setting the rowstate for the related child rows as
modified. This will cause the DataAdapter to send three rows to the
DataSource when the update method is called.

I know this is happening, because, when I call :

DataTable dt_child1 = myDataSet.t_child1.GetChanges(), the resulting
DataTable contains rows that I know I haven't updated.

dmy
 
D

David Sceppa

dmy,

Could you provide a (very) small code snippet to help reproduce the
behavior?

David Sceppa
Microsoft
This posting is provided "AS IS" with no warranties,
and confers no rights. You assume all risk for your use.
© 2004 Microsoft Corporation. All rights reserved.
 

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

Top