//////////////////////////////////////// //////////////////////////////////////// ////////////////
Dim conn as new sqlconnection
Conn. connectionstring = "Server = localhost; database = dbname; uid = sa; Pwd ="
Dim ds as dataset = new dataset
Dim selecter as string = "select * From t_table"
Dim adapter as sqldataadapter = new sqldataadapter (selecter, Conn)
Adaptid. Fill (DS, "type ")
Dropdownlist1.datasource = Ds. Tables ("type"). defaultview
Dropdownlist1.databind ()
//////////////////////////////////////// //////////////////////////////////////// ////////////////
Problem:
AboveProgramI wantDropdownlist1The control displays "Type 1", "Type 2", "Type 3", "Type 4", and "other types ",In the database Field "type" field values are "1", "2", "3", "4", "0" and other five types. How can I display it?
I plan to use the following program, but I don't know how to handle it. Please kindly advise me !!!
//////////////////////////////////////// //////////////////////
Select case type
Case "1"
Type = "Type 1"
Case "2"
Type = "Type 2"
Case "3"
Type = "Type 3"
Case "4"
Type = "type 4"
Case else
Type = "other types"
End select
//////////////////////////////////////// //////////////////////