Solved

VB.Net: Populating comboboxes from data source

Posted on 2013-01-08
5
228 Views
Last Modified: 2013-04-16
I have a couple of instances where I have a comboboxes menu in VB.Net, and I've bound it to a Binding source, which, in turn, is bound to an ".xsd" file, which defines a SQL-Server-based dataset.

I have two adjacent comboboxes, both with virtually the same arrangement of data bindings, and one populates, the other does not.  From the dataset designer, both queries work perfectly, giving me the results I expect.  As an experiment, I unchecked the box on both comboboxes that says "Use Databound items" and then re-established the datasets on both.  As before, the first resumed working and other resumed providing me with an empty list.  

I thought it time to get some advice on this.  Dropdowns have been a headache for me for a while.  Thanks, ~Peter Ferber
0
Comment
Question by:PeterFrb
5 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38759442
Are both bound to same dataset and binding source or separate?
0
 
LVL 20

Expert Comment

by:ElrondCT
ID: 38767756
If you stop the application with the debugger, does the dataset for the empty combobox have data, or is it empty?
0
 
LVL 9

Expert Comment

by:sognoct
ID: 38768032
without your code is impossible to give some help, can you attach here the form source ?
0
 

Accepted Solution

by:
PeterFrb earned 0 total points
ID: 38772762
Thanks for your comments.  I was able to solve the problem myself, on my office computer.  I don't have that in front of me at the moment, but I can describe what I did to solve the problem.  When I get back to the office, I can post some code.

The problem had to do with using the combobox itself as a data source instead of the data file.  Also the form needs a "Fill" statement to feed the control from the data source.  Those pieces were in place for one control, but not the other.  When I got through this, my dropdowns worked perfectly.

~Peter
0
 

Author Closing Comment

by:PeterFrb
ID: 39083417
I ended up solving the problem myself.  Thanks for the help, though.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL syntax in VB.net 5 30
Advice in Xamarin 21 57
rebind a grid after user clicks on node in treeview 1 17
Sql Query with datetime 3 14
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now