473,394 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Populate Combo box by placing ID in Itemdata

I want to populate the combo box in this way that to place the Client ID in the Itemdata and the name in the text. Like what can i do in VB6

combo1.additem rsLocal!ClientName
combo1.Itemdata(new index) = rsLocal!ClientID

How this functionality can achieve in .Net?

The benefit of this population is that I can get the Client ID from the itemdata and can query the database using this client id.
Sep 29 '06 #1
1 2048
dinka
2
The way to do it in .NET is to create your own object that has a data propery and ID property and to add it to the combobox

I want to populate the combo box in this way that to place the Client ID in the Itemdata and the name in the text. Like what can i do in VB6

combo1.additem rsLocal!ClientName
combo1.Itemdata(new index) = rsLocal!ClientID

How this functionality can achieve in .Net?

The benefit of this population is that I can get the Client ID from the itemdata and can query the database using this client id.
Sep 29 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Russell Potter | last post by:
I have a Combo Box, named "cbo", on a "Form" variable named "f", and, on "cbo", "Bound Column" is set to "1", "Column Count" to "1", "Row Source Type" to "Value list" and, "Row Source" to "a;b;c",...
1
by: Peter Bailey | last post by:
Thanks to the news group I can now clear a list box. The default value in properties of the combo is set to "please select a year". the code Me.CBDOSYear = Me.CBDOSYear.ItemData(0) however...
1
by: Cindi | last post by:
Hi, Another newbie with a question that I hope someone can point me in the right direction. The goal is to populate a text box with data according to the selection in a combo box while still...
5
by: Sivaprasad | last post by:
Hi, I have a combo box which displays FirstName+ Last Name of a person. I want to store their id's in the combo like we store in ItemData of VB 6 combo box. Is there any itemdata equivalent in...
1
by: Bill | last post by:
Problem: Combo box data disappears from view when a requery is done See "Background" below for details on tables, forms & controls On a form, I want to use the setting of bound combo box C1...
0
by: CalMyPal | last post by:
Basing one combo box on another January 31, 2005 By Sal Ricciardi Making choices is what a combo box is for, but sometimes one choice depends on another. In this installment, you'll learn how to...
8
by: AA Arens | last post by:
Hi I do have a products table and products-parts table in my Access 2003 database and log all services into a form. I do have at least the following two combo boxes on my form: - Choose...
2
by: docsix | last post by:
I am having trouble populating a combo box in a subform. Currently I have two combo boxes on a single form that works. This is my current setup: Table:Facilities - FacilityID ... FacilityType 1...
5
by: Tark Siala | last post by:
hi dear i'm programmer with VB6, but now i starting with C#. first problem is coming when i need fill "ComboBox Control", as you know when i fill combobox in VB6 by this code: comboX.AddItem...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.