读出数据库里面的数据,来 绑定列表框  DropDownList1            string ss_sql = "select isnull(genre_id,0) genre_id from ddw_member_info where member_id='"+this.Page.Session["member_id"].ToString()+"'";
读出数据库里面的数据,来 绑定列表框  DropDownList1            
string default_selected  = ddw.fn_execlquerysql(ss_sql); 
读出数据库里面的数据,来 绑定列表框  DropDownList1            
// 1 
读出数据库里面的数据,来 绑定列表框  DropDownList1
            this.DropDownList1.DataSource         =ddw.dataset.Tables[0].DefaultView;
读出数据库里面的数据,来 绑定列表框  DropDownList1            
this.DropDownList1.DataTextField      = "genre_desc";
读出数据库里面的数据,来 绑定列表框  DropDownList1            
this.DropDownList1.DataValueField     = "genre_id";
读出数据库里面的数据,来 绑定列表框  DropDownList1            
this.DropDownList1.DataBind();
读出数据库里面的数据,来 绑定列表框  DropDownList1            
this.DropDownList1.Items.Add(new ListItem("请选择","0"));
读出数据库里面的数据,来 绑定列表框  DropDownList1            
this.DropDownList1.Items.FindByValue(default_selected).Selected = true;        //绑定

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2021-09-29
猜你喜欢
  • 2021-12-14
  • 2021-06-06
  • 2021-08-05
  • 2021-10-24
  • 2021-07-18
  • 2021-11-15
  • 2022-12-23
相关资源
相似解决方案