Solved

Programatically databinding DropDownList located within a FormView

Posted on 2009-04-02
2
1,098 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 learn how to look for a specific file type in a local or remote server directory using PHP.

689 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