ITeye博客

给下打列表框增加数据

cab0605 · 2011-04-21 20:40 · web开发 · Web前端 · Markdown

//先定义来源

Maticsoft.BLL.ud_pub_water_type type_bll = new Maticsoft.BLL.ud_pub_water_type();

 

//给指定的下拉列表增加数据

       public void Load_type_name()
        {
            this.ddl_water_type.Items.Clear();
            DataSet ds = new DataSet();
            ds = type_bll.GetAllList();
            int li_count;
            li_count = ds.Tables[0].Rows.Count;
            for (int i = 0; i < li_count; i++)
            {
                string ls_column_name;
                string ls_column_value;
                ls_column_name = ds.Tables[0].Rows[i]["type_name"].ToString();
                ls_column_value = ds.Tables[0].Rows[i]["type_id"].ToString();
                this.ddl_water_type.Items.Add(new ListItem(ls_column_name, ls_column_value));
            }
        }

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。