Solved

Loading ComboBox2 with Selected Information from ComboBox1

Posted on 2006-07-05
3
319 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
3 Comments
 
LVL 34

Assisted Solution

by:Sancler
Sancler earned 250 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 250 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
vb.net checkbox 7 48
Want to create a userform that looks like the image provided 10 64
Need a starter for ETL protocol? 4 57
VB.NET 2008 Publish Error 2 27
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

825 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