Code Bank: ListControl.zip

File Name: ListControl.zip
File Size: 2,216 bytes
Downloaded: 603 times
Posted by: asktech
Date Posted: Thursday, April 12, 2007 (CST)
Download File: Click here to download this file

Brief Description
Create and populate Dropdown box dynamically using ASP.NET 2.0

Full Description

This small demo program will tell how you can creat a dropdown box at run time and then bind it to the database.

 

Private Sub BindData()
        Dim mySource As SqlDataSource = New SqlDataSource(GetConnectionString, "SELECT * FROM Categories")
        Dim myList As DropDownList = New DropDownList
        myList.DataSource = mySource
        myList.DataTextField = "CategoryName"
        myList.DataValueField = "CategoryID"
        Panel1.Controls.Add(myList)
        Panel1.DataBind()
    End Sub


Ratings
 

Add Your Comment

Ferotech Solution Services Inc.