?
Solved

populate combo box from a dataset

Posted on 2008-06-22
4
Medium Priority
?
257 Views
Last Modified: 2013-11-26
Hi,
can i please have help to populate a combo box from my dataset. On form loadup, i need to populate my combo box with the items in1 of my tables in my DataSet.

thanks allot

cheers
0
Comment
Question by:CraigLazar
[X]
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
  • 2
  • 2
4 Comments
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 200 total points
ID: 21840180
With Combobox1
    .DataSource = MyDataSet.Tables("TableName")
    .DisplayMember = "DisplayField"
    .ValueMember = "ValueField"
End With

Wayne
0
 
LVL 4

Author Closing Comment

by:CraigLazar
ID: 31469515
thanks mate perfect
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 21843726
if u do not mind me asking, but how would i attach the display values id to the items as then i want to save the itemID in a table and not the actual display name that the user sees in the combo box?
As in my dataset i have the display name and the itemid as fields in the dataset
thanks allot
0
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 21843798
Use Combobox1.SelectedValue.

Wayne
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

777 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