Link to home
Start Free TrialLog in
Avatar of MBHEY131
MBHEY131

asked on

data binding back to a textbox

Here is my code:

frmShopHandMain.txtLaborRate01.DataBindings.Add("Text", frmShopHandMain.Database1DataSet.Tables["Paycode"], "PayCodeRate")

I am binding at design time the text property of the above textbox and have to stop binding for various reasons and I can't seem to figure this out. Everything Is working fine at design time and field is getting updated properly.

frmShopHandMain.txtLaborRate01 = mytextbox

"Text" = Property of the textbox I want to bind to

frmShopHandMain.Database1DataSet = DataSet involved

"Paycode" = The table in the database

"PayCodeRate" = Member of the table go get the data from

Could anyone help me?

The system just keeps Underlining the code in the designer.
Avatar of MBHEY131
MBHEY131

ASKER

What I want to do is reset the bindings back in code.
vs2012 vb.net
frmShopHandMain.txtLaborRate01.DataBindings.Add(New System.Windows.Forms.Binding("Text", frmShopHandMain.Database1DataSet, "Paycode.PayCodeRate"))

I'm getting close, but no joy on the binding problem and it's getting very frustrating

The error I'm getting on the above code now is that the system cannot bind the "PaycodeRate" Column to the Textbox.
Does anybody have a suggestion?
Now the "PAYCODERATE" field the a (numeric 18,2) in the query setup and the destination is a textbox, could that be a problem and if so, how can I fix it.
ASKER CERTIFIED SOLUTION
Avatar of MBHEY131
MBHEY131

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I WAS not aware of DIRECTCAST