473,503 Members | 939 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ComboBox databinding

I have a combobox and i have a datatable with 2 columns in it
(description and code) . Now how can i display the description but use
the code as the value member.
Jul 23 '08 #1
2 1294
On Jul 23, 4:12*pm, kitema...@gmail.com wrote:
I have a combobox and i have a datatable with 2 columns in it
(description and code) . Now how can i display the description but use
the code as the value member.
And when i display the value member it just says code;
Jul 23 '08 #2
kitemad69,

You basically want to set the DisplayMember and ValueMember properties
to the name of the columns which contain the display member (description)
and value member (code).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<ki*******@gmail.comwrote in message
news:53**********************************@k30g2000 hse.googlegroups.com...
On Jul 23, 4:12 pm, kitema...@gmail.com wrote:
I have a combobox and i have a datatable with 2 columns in it
(description and code) . Now how can i display the description but use
the code as the value member.
And when i display the value member it just says code;
Jul 23 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1054
by: eye5600 | last post by:
Creating a windows form to edit address records from a SqlServer table, I want to have a ComboBox for the prefix field (Mr./Mrs./Ms./Dr.). Is it possible to populate the list in the ComboBox AND...
1
1157
by: Marius Traelnes | last post by:
Hello! I want to fill a datatable with an unique id and show a combobox based on that id, like this: id combobox 1 value1;value3;value4 2 value5;value6;value7
5
9149
by: Eric A. Johnson | last post by:
Hi Everyone, I am at my wit's end here. I have a combobox (combyQueryTitle) that I need to use in order to select a query for my database project. Therefore, I am using the...
3
7427
by: Dan Slaby | last post by:
I have a webservice that I want to populate a combobox on a windows form. The webservice creates the correct XML output, but when I attempt to bind it to a combobox I get this error: Additional...
5
3170
by: Peter M. | last post by:
I'm struggling with combobox databinding with something I consider a bug... I'm binding my combobox to an array of structs. The struct exposes two public properties, ID and Name, to be used as...
8
26380
by: | last post by:
I am sure this has been asked and answered, but here goes anyway... VS.Net 2005, VB.Net How can you display more than one field in the displaymember property of a combobox inside the...
3
6696
by: Magnus | last post by:
Im using a set combobox (ComboBox1) to provide a selection of records from a database table. I have a typed dataset (DataSet1) that contains the typed datatable (DataTable1) that the combobox is...
3
5292
by: Gerrit | last post by:
Hi, I try to learn programming in c# with databinding controls. Now I have a problem with a ComboBox with the advanced properties for databinding, I want to set the DataSourceUpdateMode to...
1
4208
by: Andrus | last post by:
I need to enter null value from combobox to business object property. My combobox datasource does not contain ValueMember with null value. So I tried to create combobox which stores null to bound...
7
13516
by: JTC^..^ | last post by:
When i attempt to bind to the "Text" and "Value" property of a combobox on a windows form the value is reset when I leave the combobox. The comboboxes contain the correct Text and Values. I know...
0
7089
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7282
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
7339
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...
1
6995
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...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.