[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Programatically databinding DropDownList located within a FormView

Posted on 2009-04-02
2
Medium Priority
?
1,110 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
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

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

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

867 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