Binding Data to a Combo Box
Binding Data to a Combo Box
Binding Data to a Combo Box
Binding Data to a Combo Box
Binding Data to a Combo Box
Binding Data to a Combo Box Binding Data to a Combo Box Binding Data to a Combo Box Binding Data to a Combo Box Binding Data to a Combo Box Binding Data to a Combo Box Binding Data to a Combo Box Binding Data to a Combo Box
Binding Data to a Combo Box Binding Data to a Combo Box
Binding Data to a Combo Box
Go Back  Xtreme Visual Basic Talk > > > Binding Data to a Combo Box


Reply
 
Thread Tools Display Modes
  #1  
Old 11-26-2009, 05:29 AM
6foot7 6foot7 is offline
Newcomer
 
Join Date: May 2009
Posts: 9
Default Binding Data to a Combo Box


Hello,

I'm trying to bind data to a combo box but it does not appear to be working. I've setup the DataSet and the DataSetBindingSource and all this appears to be working, within the form design I can expand the little arrow in the ComboBox control and preview the data. This appears to be working but when the application is run, nothing appears in the drop down box.

Has anybody any ideas, I've been at this for a over a day now and haven't made any progress.

I have the following code in place:

Code:
cmbSelectCompany.DataSource = ContactsDBDataSet.Company()
cmbSelectCompany.DisplayMember = "CompanyName"
cmbSelectCompany.ValueMember = "CompanyName"
Database name is 'ContactsDB'
Table name is 'Company'
Field name is 'CompanyName'


Regards....
Reply With Quote
  #2  
Old 11-26-2009, 07:45 AM
6foot7 6foot7 is offline
Newcomer
 
Join Date: May 2009
Posts: 9
Default

Problem solved by adding the following settings to the ComboBox properties:

DataSournce: CompanyBindingSource
DisplayMember: CompanyName
ValueMember: Company.CompanyName

I removed code under the form load event.

Thanks for the help.....
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Binding Data to a Combo Box
Binding Data to a Combo Box
Binding Data to a Combo Box Binding Data to a Combo Box
Binding Data to a Combo Box
Binding Data to a Combo Box
Binding Data to a Combo Box Binding Data to a Combo Box Binding Data to a Combo Box Binding Data to a Combo Box Binding Data to a Combo Box Binding Data to a Combo Box Binding Data to a Combo Box
Binding Data to a Combo Box
Binding Data to a Combo Box
 
Binding Data to a Combo Box
Binding Data to a Combo Box
 
-->