TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
pria525
NA
8
0
Array of Checkboxes or Checkboxes in a PlaceHolder
Oct 5 2004 11:34 AM
Hi Folks, This is my first post here. If this is not the correct forum to post, do accept my apologies. I am working on creating checkboxes dynamically. I have a stored procedure that reads a list of interests from a table and these have to be displayed as checkboxes. I do this using a place holder and what I get is a series of checkboxes with column name next to them, but I want the values in that column and not column name. for(int i = 0; i < myDS.Tables["Interests"].Rows.Count; i++) { CheckBox objCheckBox = new CheckBox(); objCheckBox.ID = myDS.Tables["Interests"].Columns["InterestTypeID"].ToString(); objCheckBox.Text = myDS.Tables["Interests"].Columns["InterestType"].ToString(); phlInterests.Controls.Add(objCheckBox); } If I create an array of checkboxes, I keep running into an error Object reference not set to an instance of an object. Could someone point me in the right direction. Thanks, Priya
Reply
Answers (
8
)
Getting derived object from the base object
Appending to an XML file C#