473,320 Members | 1,810 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,320 software developers and data experts.

How can i populate a combobox with one field of a database table

I would like to fill a combobox with particular field for example if i have atable with fields such as CustID, CustName,CustAge, I wuold love to only fill the combobox with the Name filed such that only the CustNames will be field in the combobox and am able to write an event handler for the selected index.
Thanks in advance
Frank Belex
Apr 17 '12 #1
1 1675
Expand|Select|Wrap|Line Numbers
  1. comboBox1.DataSource = ds.Tables[0];
  2.   comboBox1.ValueMember = "id";
  3.   comboBox1.DisplayMember = "lname";
http://csharp.net-informations.com/d...t-combobox.htm

eldo.
May 5 '13 #2

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

Similar topics

1
by: newbie | last post by:
Hello, I am using a propertygrid to allow users to edit\create objects at runtime, that can update records in a database. There are certain properties (fields) that I wish to display as...
2
by: Nicolae Fieraru | last post by:
Hi All, Could somebody provide me step by step instructions of how to populate a combobox with values from a table (any table from northwind.mdb will do). What I have done is: - I added on the...
1
by: Robert Brown | last post by:
Hi All.. Is there a way to populate a combobox with the column names returned from an SQL query, rather than filed information? Yes, I could hard code the column names into the Combo Box, but...
3
by: Georges Heinesch | last post by:
Hi. I have a ComboBox in a table (tbl1), which is populated by another table (tbl2). The ComboBox "Row Source Type" is set to "Table/Query", and the "Row Source" is set to "tbl2". In this...
2
by: The_Monkey | last post by:
I have created a form with a combo box to filter a subform using a date. The filter works great but not with dates starting with a 0 e.g 01/07/2006 I have set the format to short date for the...
5
by: Andrus | last post by:
I'm creating a database Winforms application using VCS Express 2005 I have some large lookup tables (may be up to 500000 records) which contains name and id and are stored in sql server. I...
3
by: neelesh kumar | last post by:
sir, i have 2 tables namely tblexam and subject. in tblexam fields r questionno,subcode,question,options and answer. in subject table fields r subcode,subname. i created form using wizard from...
2
by: Randy | last post by:
Hi, I have a small table - 2 columns, 5 rows. Col 1 is the key column and has integer values of 1 through 5. Column 2 is a varbinary(MAX) column and has jpg images loaded in it. What I want...
1
by: lrheeza | last post by:
Hello, More questions from this newbie: I have an Application table which has Application ID and Application Name. I have another table Variable which has Variable ID, Application ID and other...
14
by: Mark | last post by:
I have a table with a field that uses a combobox to populate values. The Lookup tab within table design mode is the following: Display Control Combo Box Row Source Type ...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.