URGENT: DataSet.GetChanges() returns an old version of the row

  • Thread starter Thread starter Frank Hauptlorenz
  • Start date Start date
F

Frank Hauptlorenz

Hi together,

I experience the following situation:

One row is added to a DataSet with default values. These values will
changed later by the user. If the users saves now
I do an DataSet.GetChanges() to just deal with the changed rows. And
that is also the place where the problem starts:
my original DataSet contains the actual values but that one created by
GetChanges() contains the row in the state as it
was added (with the default values again).

Has someone any clue what this can be?

Thanks a lot,
Frank
 
Hi Frank,

Welcome to MSDN Managed Newsgroup. My name is Lingzhi Sun [MSFT]. It's my
pleasure to work with you on this ADO.NET problem.

DataSet.GetChanges(), with no parameters, returns a copy of the DataSet
that contains all changes(added, modified, and deleted) made to it since it
was loaded or since AcceptChanges was last called. If GetChanges() is
called when the new row is added but the user has not modified it, we get a
DataSet which contains all the original data and the new row with default
values. However, if GetChanges() is called after the user has modified the
new row, we get a DataSet that contains all the original data and the new
row with modified values.

Please note: Once the new row is added into the DataSet, its DataRowState
is set to Added. Before the changes are accepted or reset, even if the new
row is modified, its DataRowState is still Added instead of Modified.

Frank, could you please clarify when the GetChanges is called? Before the
new row is modified or after that? Also, did you pass any parameters to
the GetChanges method to filter the data or just call the GetChanges with
no parameters?

If you have any questions or concerns, please feel free to let me know.

Have a nice day!


Best Regards,
Lingzhi Sun
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

MSDN Managed Newsgroup support offering is for non-urgent issues where an
initial response from the community or a Microsoft Support Engineer within
2 business day is acceptable. Please note that each follow up response may
take approximately 2 business days as the support professional working with
you may need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations that require urgent,
real-time or phone-based interactions. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Lingzhi,

GetChanges() is called after the row is modified. Also it's called
without parameters.
In the meanwhile I figured out that it has to do with data binding to UI
components. I'm using the infragistics data source
for this. If I disable their data binding it is working, so it has
nothing to do with ADO.Net.

Thanks,
Frank


Hi Frank,

Welcome to MSDN Managed Newsgroup. My name is Lingzhi Sun [MSFT]. It's my
pleasure to work with you on this ADO.NET problem.

DataSet.GetChanges(), with no parameters, returns a copy of the DataSet
that contains all changes(added, modified, and deleted) made to it since it
was loaded or since AcceptChanges was last called. If GetChanges() is
called when the new row is added but the user has not modified it, we get a
DataSet which contains all the original data and the new row with default
values. However, if GetChanges() is called after the user has modified the
new row, we get a DataSet that contains all the original data and the new
row with modified values.

Please note: Once the new row is added into the DataSet, its DataRowState
is set to Added. Before the changes are accepted or reset, even if the new
row is modified, its DataRowState is still Added instead of Modified.

Frank, could you please clarify when the GetChanges is called? Before the
new row is modified or after that? Also, did you pass any parameters to
the GetChanges method to filter the data or just call the GetChanges with
no parameters?

If you have any questions or concerns, please feel free to let me know.

Have a nice day!


Best Regards,
Lingzhi Sun
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

MSDN Managed Newsgroup support offering is for non-urgent issues where an
initial response from the community or a Microsoft Support Engineer within
2 business day is acceptable. Please note that each follow up response may
take approximately 2 business days as the support professional working with
you may need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations that require urgent,
real-time or phone-based interactions. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top