DataSet.HasChanges = True after DataSet Loaded

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

Guest

I have a form with various controls on it. After I load my DataSet and show
the form, I make no changes to the data in the controls on the form. On
close, I check to see if the DataSet HasChanges is True. However, it is
always true after looping through all of the tables in the DataSet and
setting the BindingContext to EndCurrentEdit.

There has to be something very basic I am missing here. Am I supposed to
call AcceptChanges after the form's data is loaded?

Thanks in advance!!
 
I figured it out. After hours of looking, all it took was a smoke break. I
decided to comment out big sections of my BindData routine (I have about 200
controls on this form) to see if HasChanges was always true or something in
my code was causing it.

It turns out that I was binding some ComboBoxes (DropDownStyle = DropDown)
using the SelectedItem property when I should have been using the Text
property. Another lesson learned the hard way.
 
Back
Top