This article is a mirror article of machine translation, please click here to jump to the original article.

View: 17632|Reply: 0

[ASP.NET] asp.net space dropdownlist bind database

[Copy link]
Posted on 4/18/2015 5:25:50 PM | | |
Code:
<asp:DropDownList ID="bid" runat="server"></asp:DropDownList>

CS code
string cStr = "select id,classname from classify order by id asc";
        SqlDataAdapter cRs=new SqlDataAdapter(cStr,conn);
        conn. Open();
        DataSet cRd = new DataSet();
        cRs.Fill(cRd);
        bid. DataSource = cRd;
        bid. DataTextField = "classname"; Bind the field of the display name
        bid. DataValueField = "id"; Fields that bind values
        bid. DataBind();
        conn. Close();





Previous:For security reasons, the file cannot be viewed. Please contact your system administrator and check the CKFinder profile.
Next:asp.net use ckeditor_3.6.2+ckfinderckfinder_aspnet_2.1.1 to set up the image upload function
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com