DataSet.HasChanges = True after DataSet Loaded

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!!
 
G

Guest

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.
 

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