Why isn't dataset.HasChanges changing?

Posted on 2006-03-30
Last Modified: 2010-04-23
I have textboxes bound with a bindsource to a dataset.  I have typed changes into my textbox, but when I check dataset.HasChanges it is still set at False.

I thought if the dataset changed then the textbox would change as well as vice-versa, if the textbox changes, then the dataset would changes.

So, what do I need to do to ensure that when a textbox.text changes, then the bound dataset also changes?
Question by:vlvawter
    LVL 34

    Accepted Solution

    Changes made in bound controls are only committed to the dataset when the "current edit" ends.  That happens automatically if the user navigates to another record.  But otherwise you have to call .EndCurrentEdit for the binding manager concerned, before they will be reflected in .HasChanges.

    If you have a CurrencyManager (e.g. so that "forward" and "back" buttons will work)


    should do it.  If not

       Me.BindingContext(<name of data Source>).EndCurrentEdit

    should be OK.  In either case, put it just before your .HasChanges check.


    Author Comment


    I've done a lot of experimenting, and the ADO flow is making more sense.  I use me.bindingsource.endedit, which produceds the same result as your code.


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Article by: jpaulino
    XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String ( Literal, only instead of starting and ending with w…
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now