Solved

data binding back to a textbox

Posted on 2015-01-24
8
132 Views
Last Modified: 2015-01-26
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.
0
Comment
Question by:MBHEY131
  • 6
8 Comments
 

Author Comment

by:MBHEY131
ID: 40568559
What I want to do is reset the bindings back in code.
0
 

Author Comment

by:MBHEY131
ID: 40569092
vs2012 vb.net
0
 

Author Comment

by:MBHEY131
ID: 40571194
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?
0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 

Author Comment

by:MBHEY131
ID: 40571197
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.
0
 

Accepted Solution

by:
MBHEY131 earned 0 total points
ID: 40571384
This is the Code that is the answer:

strPayRate = DirectCast(frmShopHandMain.cboPayCD_01.SelectedItem, DataRowView).Item("PayCodeRate")

I was not aware of DIRECTCAST and don"t even need to do the binding.
0
 

Author Closing Comment

by:MBHEY131
ID: 40571385
I WAS not aware of DIRECTCAST
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

911 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

20 Experts available now in Live!

Get 1:1 Help Now