Solved

Programatically databinding DropDownList located within a FormView

Posted on 2009-04-02
2
1,087 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 500 total points
Comment Utility
0
 
LVL 1

Author Closing Comment

by:Anubis2005
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Asp/Net Validation date Issue 9 36
Duplicate a row 2 28
Create XML 5 30
Problem to page 4 16
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
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.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now