Databound TextBox not updating underlying database

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.

Who is Participating?
GranModConnect With a Mentor Commented:
Closed, 500 points refunded.
The Experts Exchange
Community Support Moderator of all Ages
Try calling .EndEdit() on your bindingSource before .Update()

JAMESAuthor Commented:
If you mean like this :-


then this doesnt work....

Anymore thoughts?
JAMESAuthor Commented:
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.


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.