Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / December 2005

Tip: Looking for answers? Try searching our database.

Dataset says record was updated, but it wasn't - why?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JohnR - 07 Dec 2005 18:24 GMT
I load a table into a dataset and when I click my SAVE button, I get the
changes like this:
dsChanged = ds.GetChanges()
I then parse each row in dsChanged and have found that some of the rows are
marked as 'modified' when I didn't change any values in the record.  I then
created a routine that would take this row and for each field in the row it
would compare the DataRowVersion.Original to the DataRowVersion.Current
values.  If they were different I would display the differences in a listbox
for me to see.
What's happening is that the listbox contains no changes, unless I really do
change a field... then my change does show.

My question is this... what would cause the dataset to set the 'modified'
flag on a record when it was not changed?    I'm at a total loss as to why
this would happen.  It must be something I'm doing wrong, but I can't figure
it out.  Any suggestions?

John
Bart Mermuys - 07 Dec 2005 22:11 GMT
Hi,

>I load a table into a dataset and when I click my SAVE button, I get the
>changes like this:
[quoted text clipped - 5 lines]
> DataRowVersion.Current values.  If they were different I would display the
> differences in a listbox for me to see.

Even when you assign the _same_ value to a certain row/field then the row
will be marked as modified.  So even when all Original values are the same
as Current values the row can still be in a modified state.

So something is actuallly setting the same values.  Could be caused by
binding to a Control property that doesn't have a Changed event or a Changed
event that fires even when the new property value is the same as the old
one.

Or maybe you're assigning the same values yourself somewhere, hard to say
without more information.

HTH,
Greetings

> What's happening is that the listbox contains no changes, unless I really
> do change a field... then my change does show.
[quoted text clipped - 5 lines]
>
> John

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.