?
Solved

data binding back to a textbox

Posted on 2015-01-24
8
Medium Priority
?
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Learn how to automatically add page numbers in your next InDesign project. This can be very helpful in multi-page books and magazines that you are designing. Make sure your Pages window visible.:  In the document you wish to add page numbers to. Act…
Suggested Courses

765 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