d2005
Active member
want to populate a drop down list
my code doesnt seem to work, is it the fill method is a problem??
in my table i have just 2 columns with only one column name
table name = tb_area
columns = area_code, area_name
i just want to display area name.
my code doesnt seem to work, is it the fill method is a problem??
in my table i have just 2 columns with only one column name
table name = tb_area
columns = area_code, area_name
i just want to display area name.
VB.NET:
Private ddlArea As New DropDownList
Private daArea As New SqlDataAdapter
.................
daArea.SelectCommand = New SqlCommand("SELECT * from tb_area", oSQLConn)
ddl_area.Fill(ddlArea)
ddlArea.DataSource = daArea.Tables(0)
ddlArea.DataBind()
oSQLConn.Close()