Databound TextBox not updating underlying database

Posted on 2006-05-03
Last Modified: 2008-02-01
This is related to another question I have outstanding but I will keep this as a new question also.

I have a data adapter with an associated dataset on my windows form.  I also have a text box that has it's "databindings.text" property set to the correct column in my table (all done from the property editor, not code).

I .fill this dataset and, sure enough, the textbox gets populated.  I then simply edit the data in the textbox and in the edtFolder_Leave event i perform a .update but... nothing gets updated.  I have checked the update sql server code in the update property and all this looks fine.

Why does my underlying data in my sql server table not get updated?

What am I missing?

Many thanks.

Question by:JAMES
    LVL 6

    Expert Comment

    Try calling .EndEdit() on your bindingSource before .Update()


    Author Comment

    If you mean like this :-


    then this doesnt work....

    Anymore thoughts?

    Author Comment

    Here is the solution - god that was so much harder than it should have been!

    this.BindingContext[MyDataSet, "MyTabler"].EndCurrentEdit();

    I think it best this question is simply now closed without awarding any points.



    Accepted Solution

    Closed, 500 points refunded.
    The Experts Exchange
    Community Support Moderator of all Ages

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Suggested Solutions

    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
    This video discusses moving either the default database or any database to a new volume.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    745 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

    13 Experts available now in Live!

    Get 1:1 Help Now