C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




What are the ways to bind data to a drop down list?


Posted Date: 30 Apr 2008    Resource Type: Articles    Category: Web Applications

Posted By: Vivs       Member Level: Gold
Rating:     Points: 10



I don’t think there exists any meaningful application which does not have at least one “dropdownlist” control. Every user definitely knows what a “dropdownlist” is. The most important issue is that a “dropdownlist” can maintain two sets of values inside.

The first set of values display generally the “textual” information (which is visible to the user). The second set of values is “hidden” from the user. The user would never know about the “hidden” information. This flexibility is particularly necessary when you want to display only “student names” to the user and work with “regdno” behind the scenes. Of course, the user may not identify any student just with the “regdno”!

Not every scenario needs the two sets of values. Some may need only one set of values (both “text” and “value” would be the same). The “dropdownlist” control in ASP.NET supports both of these scenarios.

The process of attaching the “dropdownlist” control to a source of data is nothing but “data binding.” This process of “binding” can occur in several ways including databases, arrays, and so on. In this article, we will mainly look at the following ways to bind (or place) information into a “dropdownlist” control.

Binding to a Simple Array

Binding to an ArrayList

Binding to a hashtable

Binding to a data table

Binding to a data set

Binding to a data view

Binding to a set of objects

Binding manually
The above are the most frequently used “data binding” mechanisms when we work with a “dropdownlist” in ASP.NET. Now, let us go through each of those methodologies.





Responses

Author: Sebastian    13 Jun 2008Member Level: Gold   Points : 1
This is very informative. Thanks for sharing the details.


Author: Gaurav Agrawal    19 Jun 2008Member Level: Silver   Points : 2
Hi vivs,
Very nice article.
but I think some examples are missing.
But still good Post.
Keep Posting your resources and help your fellow developers.
happy porgramming

Regards
Gaurav Agrawal


Author: Kapil Dhawan    19 Jun 2008Member Level: Gold   Points : 2
Hello
Nice piece of article
Thanks for sharing your knowledge with us.
I hope to see more good artile from your side
This articleis going to help lots of guys.
Ton Thanks to you
Regards,
Kapil



Author: Jins Philip    19 Jun 2008Member Level: Gold   Points : 0
Cool


Author: UltimateRengan    01 Jul 2008Member Level: Diamond   Points : 0
nice Articles.thanks for sharing your knowledge


Author: Roopesh Babu Valluru    15 Jul 2008Member Level: Gold   Points : 0
xamples are missing...


Author: Nilla    17 Jul 2008Member Level: Silver   Points : 0
nice information..thanks to sharing


Author: surender    01 Aug 2008Member Level: Silver   Points : 0
nice article posted by u...


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Caching in asp.net Page
Previous Resource: ASP.NET Page Life Cycle
Return to Discussion Resource Index
Post New Resource
Category: Web Applications


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

it outsourcing

Contact Us    Privacy Policy    Terms Of Use