?
Solved

Loading ComboBox2 with Selected Information from ComboBox1

Posted on 2006-07-05
3
Medium Priority
?
332 Views
Last Modified: 2010-04-23
Right now

I am loading Combobox 1 with customer codes on teh form load.

Now in the event where the index is changed I want to load Combobox2 using the information that was selected in ComboBox 1

for eg.

on form load combobox1 is populated with customer code names

when a user selects a customer code name combobox2 will be populated with all the order numbers and then when the user selects the order number it will populate the rest of my form according to the values in combobox 1 and combobox 2


But I get this error.

"There is already an open DataReader associated with this Connection which must be closed first."


I can get around this error if I have a button that loads the rest of the form.  But I rather load the rest of the form once Combobox2 item is selected

0
Comment
Question by:foobarr
[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
3 Comments
 
LVL 34

Assisted Solution

by:Sancler
Sancler earned 750 total points
ID: 17043832
I think we need to see the code, involving the datareader/s, which loads the comboboxes and form.  That, from the error message, is where the problem lies and what you may be loading from the datareader/s doesn't really tell us much about how you are handling it/them.  And whether you're using VB.NET 2002, 2003 or 2005 might be helpful to know.

Roger
0
 
LVL 4

Accepted Solution

by:
g_johnson earned 750 total points
ID: 17044416
somewhere you are re-using a datareader, but not closing it first

like,

while rdr1.read
    '' doing something
loop

rdr1.close   <----------------- this is mising

0
 
LVL 7

Author Comment

by:foobarr
ID: 17050926
the error was coming from a Fill command.

I think the problem was that I was querying the same table but different fields using differen queries, and it was doing it at the same time.  

So I cheated and in my combobox1 I checked if it was done populating, if it was I then populate the next combobox, and somehow that worked...


I was using that query with all of my other forms so it was odd that it didn't work in this instance.  

Maybe its something I need to look into later on especially during the testing phase...The problem is I didn't write that query method so I probably will have to go through agin later on
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

718 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