现在的位置: 首页 > 综合 > 正文

DropdownList绑定

2012年09月26日 ⁄ 综合 ⁄ 共 708字 ⁄ 字号 评论关闭
1.Hashtable Ht = new Hashtable();
            Ht.Add("bcgsl", "不成功数量");
            Ht.Add("zsl", "交易总数量");
            Ht.Add("bcgl", "不成功率");
            this.DropDownList4.DataSource = Ht;
            this.DropDownList4.DataValueField = "key";
            this.DropDownList4.DataTextField = "value";
            this.DropDownList4.DataBind();
2.
 this.DropDownList2.Items.Add(i.ToString("D2"));

3.

using System.Collections;
 ArrayList ar = new ArrayList();
            DataTable dt = sDS.Tables[0];
            foreach (DataRow dr in dt.Rows)
            {

                ar.Add(dr[0].ToString());
                InsertSZKSKH(dr[0].ToString(), (int)dr[1], time);

            }


            this.DropDownList3.DataSource = ar;
            this.DropDownList3.DataBind();

抱歉!评论已关闭.