PC Review


Reply
Thread Tools Rate Thread

Binding textboxes (again)

 
 
VB Learner
Guest
Posts: n/a
 
      28th Feb 2005
I have a simple experimental form with a few textboxes and a couple of
buttons which move the BindingContext(..).Position up and down, and
another button to Update the database.
I can click through the records fine using the up/down buttons, but
when I type a new value into one of the textboxes, then click Update, it
doesn't get saved.
However, it DOES get saved if I click Up or Down away from that record
before clicking update.
Should I put something in the text_changed handler of the textboxes?
What?

Thanks,
VBL



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
VB Learner
Guest
Posts: n/a
 
      28th Feb 2005
Hmmm... on re-reading the above question, it seems some more info might
be helpful to any kind person trying to answer it:

I'm using VB .NET with MSDE, a Connection, an SqlDataAdaptor, and a
DataSet. The TextBoxes have databindings to the table. The text in
the modified TextBox goes into the DataSet ok, because clicking away
from, and then back to, that record shows the modified text, but it
doesn't get saved with Update UNLESS I click away from the record first.
Just typing in the new value then doing the Update doesn't work.

Thanks again,




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
=?Utf-8?B?SmF5IFBvbmR5?=
Guest
Posts: n/a
 
      1st Mar 2005
You need to call the CurrencyManagers EndCurrentEdit Method before you call
your Update method. This will move the textbox value into the underlying
record.

To obtain the CurrencyManager:

dim oCM as CurrencyManager

oCM = CType(Me.BindingContenxt(YourDataSource, YourDataMember),
CurrencyManager)

then call oCM.EndCurrentEdit


"VB Learner" wrote:

> Hmmm... on re-reading the above question, it seems some more info might
> be helpful to any kind person trying to answer it:
>
> I'm using VB .NET with MSDE, a Connection, an SqlDataAdaptor, and a
> DataSet. The TextBoxes have databindings to the table. The text in
> the modified TextBox goes into the DataSet ok, because clicking away
> from, and then back to, that record shows the modified text, but it
> doesn't get saved with Update UNLESS I click away from the record first.
> Just typing in the new value then doing the Update doesn't work.
>
> Thanks again,
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
>

 
Reply With Quote
 
VB Learner
Guest
Posts: n/a
 
      1st Mar 2005
That works good!
Thanks,


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding textboxes to dataset relationship =?Utf-8?B?TSBL?= Microsoft Dot NET Framework Forms 7 11th Sep 2009 04:56 PM
Binding to TextBoxes on MySQL with C# jwitt Microsoft ADO .NET 1 3rd Mar 2006 07:48 AM
binding data with textboxes alpoor Microsoft ASP .NET 2 16th Jun 2005 09:32 PM
Binding textboxes Big E Microsoft ASP .NET 3 5th Jun 2004 03:48 AM
Questions about binding textboxes. Aaron Microsoft Dot NET Framework Forms 2 30th Jan 2004 08:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:56 AM.