?
Solved

Programatically databinding DropDownList located within a FormView

Posted on 2009-04-02
2
Medium Priority
?
1,099 Views
Last Modified: 2012-05-06
Hello,

I have a FormView which has a DropDownList located within it.  I am needing to set the List's DataBinding programatically (I've seen ways to do it non-programatically, but none solved my requirements) and the problem I'm encountering is, when I'm performing my programming in the OnDataBound event of the FormView:

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

I don't want to enable multiple open DataReaders on my connection so I'm trying to find another way around it.  

I tried putting the databinding in the OnPageLoad event but when I tried to call FormView.FindControl("MyDropDown") it returned null.

Thanks
Anubis.
0
Comment
Question by:Anubis2005
[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
2 Comments
 
LVL 27

Accepted Solution

by:
nmarun earned 2000 total points
ID: 24056802
0
 
LVL 1

Author Closing Comment

by:Anubis2005
ID: 31566106
Using the link at aspfree.com mentioned using a HashTable as the datasource for binding and reminded me that I could have done it by calling the data from the db into a hashtable and then binding to the control when I needed.
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

770 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