Solved

data binding back to a textbox

Posted on 2015-01-24
8
152 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
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Suggested Solutions

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.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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…

738 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