Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 3rd, 2007, 05:01 AM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Associate a combobox with a textbox

About this subject we can find in the Wrox book "Expert One on One Visual Basic 2005" in chapter 4 page 159 the following code:
With cboEmployeeID
     .DataSource = dsLookups.Tables("EmplsLookup")
     .DisplayMember = "EmployeeName"
     .ValueMember = "EmployeeID"
     .DataBindings.Clear()
     .DataBindings.Add(New Binding("SelectedValue", OrdersBindingSource, "EmployeeID, True))
End With

Because i'm not sure i understand this code correct, i like if my understanding as follows is wright or wrong:
As i understand this code I believe that first of all the combobox is bound to the table "EmplsLookup" ,shows the EmployeeName of the current Employee, but saves its EmployeeID.
Next the binding is broken and a new binding is made, but now the selected value of the combobox ( = EmployeeID ?) is bound to the field EmployeeID of the OrderBindingSource.
Is this correct and what happens after the second binding is made?
Does this means that the selected value in the combobox will be changed to the current EmployeeID from the OrdersBindingSource ?





Similar Threads
Thread Thread Starter Forum Replies Last Post
not enable textbox or combobox font color SabinoFonseca VB.NET 2002/2003 Basics 1 March 15th, 2007 01:52 PM
how to associate a filetype with a windows service connect2sandep .NET Framework 2.0 0 September 7th, 2006 01:21 PM
associate keyboard return to a button silvia C# 8 February 28th, 2006 05:06 PM
Associate script with a folder... MaX. VBScript 0 October 15th, 2004 01:26 PM
Associate "Find" command on form grahampinkney Access 3 August 23rd, 2004 05:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.