绑定事件的演示:
SqlDataAdapter adapter = new SqlDataAdapter(sql, myConnection);
DataSet ds = new DataSet();
adapter.Fill(ds);
this.droplist.DataSource = ds.Tables[0];
this.droplist.DataTextField = "IncName"; //显示的值
this.droplist.DataValueField = "IncID";//后台的值
this.DataBind();//绑定
阅读(604) | 评论(0) | 转发(0) |