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 !




Implementing Datatable in Combo Box Control


Posted Date: 30 May 2006    Resource Type: Articles    Category: .NET Framework
Author: sourirajan saravananMember Level: Gold    
Rating: Points: 5



Example for Windows Application [VB.Net]


Dim list As New DataTable
list.Columns.Add(New DataColumn("Display", GetType(String)))
list.Columns.Add(New DataColumn("Id", GetType(String)))
list.Rows.Add(list.NewRow())
list.Rows.Add(list.NewRow())
list.Rows(0)(0) = "Yes"
list.Rows(0)(1) = "Y"
list.Rows(1)(0) = "No"
list.Rows(1)(1) = "N"

Me.cmb.DataSource = list
Me.cmb.DisplayMember = "Display"
Me.cmb.ValueMember = "Id"


Example for Web Application [ASP.Net + VB.Net]


Dim list As New DataTable
list.Columns.Add(New DataColumn("Display", GetType(String)))
list.Columns.Add(New DataColumn("Id", GetType(String)))
list.Rows.Add(list.NewRow())
list.Rows.Add(list.NewRow())
list.Rows(0)(0) = "Yes"
list.Rows(0)(1) = "Y"
list.Rows(1)(0) = "No"
list.Rows(1)(1) = "N"

Me.drpYesNo.DataSource = list
Me.drpYesNo.DataTextField = "Display"
Me.drpYesNo.DataValueField = "Id"
Me.drpYesNo.DataBind()




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

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: How to upload a file to a Web server in ASP.NET by using c# (C Sharp)
Previous Resource: Interview Questions with answers I on .Net
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use