Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 18th, 2006, 02:14 PM
Authorized User
 
Join Date: Jan 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamic checkbox and radiobutton lists

I am using C#.NET and want to have dynamically created checkboxes and radio buttons. My database connection is hardcoded in (not using the .NET connection) and I want to retrieve information from the database, display it in either a checkbox list, or a radio button list, and allow users to check or click their choice. It is easy enough to set up either list, but I do not know how to populate them from a database. Any help or hints would be welcome.

 
Old March 29th, 2006, 07:32 AM
Registered User
 
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mr. Ric_H,

 Can you give more details? So, I can help you out.

Sree Harshavardhana.
 
Old March 30th, 2006, 01:52 PM
Authorized User
 
Join Date: Jan 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Using a DataReader I found that you can use

while ( objReaderUser.Read() == true)
{
        ListItem cblEstI = new ListItem();
    cblEstI.Text = objReaderUser["market_desc"].ToString();
    cblEstI.Value = objReaderUser["market_id"].ToString();
    cblEst.Items.Add( cblEstI );
}








Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with dynamic drop down lists MarkGT Classic ASP Basics 3 April 29th, 2008 06:05 PM
Dynamic Radiobutton inside Templatefield carthic143 ASP.NET 1.0 and 1.1 Basics 0 January 5th, 2008 07:33 AM
Dynamic checkbox and radiobutton lists Ric_H C# 1 April 5th, 2006 05:04 AM
Dynamic check boxes and select lists bsheridan Classic ASP Basics 1 March 17th, 2006 05:39 AM
Help - Dynamic Pop-down lists phpcoder1 PHP How-To 0 November 8th, 2004 12:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.