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

Populating ComboBox from Table

thank you in advance for any and all assistance.

I'm trying to populate a combobox with a table in VB.Net.

Table Name: tblBreed
cboBreed

Thank you again.

Michael
Nov 20 '05 #1
8 7305
Cor
Hi Micheal,

I think you get a lot of answers, because this is simple in vb.net

cbobreed.datasource = tblBreed
cbobreed.displaymember = "MyTableText"
cbobreed.valuemember = "Mytablevalue"

I hope this helps?

Cor
Nov 20 '05 #2
Hi,

cboBreed.DataSource=tblBreed
cboBreed.DisplayMember = "FieldNameToDisplay"

Ken
--------------
"Lumpierbritches" <lu*************@aol.com> wrote in message
news:20***************************@mb-m28.aol.com...
thank you in advance for any and all assistance.

I'm trying to populate a combobox with a table in VB.Net.

Table Name: tblBreed
cboBreed

Thank you again.

Michael

Nov 20 '05 #3
I get this when I put this in the Form Load Event:

System.Data.DataViewManagerListItemTypeDescriptor
Nov 20 '05 #4
Cor
Hi Lumpier.....

cbobreed.displaymember = "MyTableText"
cbobreed.valuemember = "Mytablevalue"

Did you use that "MyTableText" or the name from the column in your table (or
said in another way, the column (item) name in the database)?

(It has to be between quotes)

The valuemember is not necessary if you do not use it.

I hope that it will work now?

Cor
Nov 20 '05 #5
I'm too dense to understand. I've tried in the cboBreed event change, and in
the formload event to load the values in table breed into my combo box and all
I get is

System.Data.DataViewManagerListItemTypeDescriptor

HELP!!! I'm gettting so frustrated. In VB6, there was a data combobox that
allowed for data porting to the combobox and a wizard for idiots like me.
Nov 20 '05 #6
Hi,

You probably have the column name wrong. Try this.

cboBreed.DataSource=tblBreed
cboBreed.DisplayMember = tblBreed.Columns(0).ColumnName

Ken
------------------
"Lumpierbritches" <lu*************@aol.com> wrote in message
news:20***************************@mb-m25.aol.com...
I'm too dense to understand. I've tried in the cboBreed event change, and in the formload event to load the values in table breed into my combo box and all I get is

System.Data.DataViewManagerListItemTypeDescriptor

HELP!!! I'm gettting so frustrated. In VB6, there was a data combobox that
allowed for data porting to the combobox and a wizard for idiots like me.

Nov 20 '05 #7
Ken,

Thank you for your assistance. I can get the first, "selected" value, but I
still can't populate the combobox with the values in the table. Here is my
complete code:

Private Sub frmAnimal_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
AnimalDA.Fill(Animal1, "tblAnimal")
BreedDA.Fill(Breed1, "tblBreed")
End Sub

Private Sub cboBreed_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles cboBreed.SelectedIndexChanged
cboBreed.DataSource = Breed1.tblBreed.Columns(0)
End Sub
Nov 20 '05 #8
Cor
I did not see Ken today.
">
Private Sub frmAnimal_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
AnimalDA.Fill(Animal1, "tblAnimal")
BreedDA.Fill(Breed1, "tblBreed") cboBreed.DataSource = Breed1.tables("tblBreed")
cboBeed.displaymember= Breed1.tables("tblBreed").Columns(0) End Sub


I asume you did the rest using the designer (wizards)

This is almost as Ken wrote.

Cor
Nov 20 '05 #9

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

Similar topics

2
by: Big Time | last post by:
Hi, I have a question regarding using drop down lists and how to get them to limit the list of a subsequent field. I have a database which has the names of colleges. Each college has it's own...
8
by: Roy Padgett | last post by:
I have a combo box where users select the customer name and can either go to the customer's info or open a list of the customer's orders. The RowSource for the combo box was a simple pass-through...
5
by: Geoff Portbury | last post by:
I'm a swimming club coach. I have a data base for recording times at various meets. I have a FORM for entering times called SWIM TIMES. When I enter the swimmers name ID, eg FOR01 for Doug Ford I...
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...
0
by: Henry | last post by:
I have a dataset dsMain in which I have two tables The table period has columns like period_id, name, root_org_id.... The table organization has org_id, name, parent_id, hier_path, level,...
2
by: John Ninan | last post by:
I am creating Dynamic Usercontrol in Asp.net application. In this application I have a combobox(aspx Page). Which contains various items. Based on item selected I am dynamically populating...
2
by: Bill Brinkworth | last post by:
in vb.net 2005, i would like to pull up a name from a database (customers) (i can do this already), then after a name is selected from a combox box, to populate the form's text boxes with with data...
4
by: c_shah | last post by:
I am a beginner and learning VB.net There are two wasy to bind a combobox or a listbox First approach is to assign a datasource and displaymember Second approach is to iterate through datarow...
3
by: davenumber40 | last post by:
I’m creating a small database in Access 2003(XP) to track issues during software testing. As far as databases go, it’s going to be a relatively small, short term project (No more than 20,000 records...
6
by: buterfly0707 | last post by:
hi.. i want to fill my combobox from the values which im having in my table in the database. and my combobox name is combobox1 and my table is tblDetails, and this table having two columns code...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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: 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: 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
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.