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
Solved

data binding back to a textbox

Posted on 2015-01-24
8
142 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

The ability to automatically add page numbers to a layout is one of the many easy, convenient features InDesign has to offer. There are many reasons why you would want to automatically generate page numbers in your next project, so whether it’s a ma…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

856 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