[URGENT] I beg you to give me some advice on the "dropdownlist1" control!

Source: Internet
Author: User

//////////////////////////////////////// //////////////////////////////////////// ////////////////

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

//////////////////////////////////////// //////////////////////

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.