Solved

populate combo box from a dataset

Posted on 2008-06-22
4
253 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
  • 2
  • 2
4 Comments
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 50 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

809 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