ComboBox绑定

this.ComboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
this.ComboBox1.AutoCompleteSource = AutoCompleteSource.ListItems;
this.ComboBox1.DropDownWidth = 400;
this.ComboBox1.DropDownHeight = 400;
string sql = " sql语句 ";
DataTable dt = LinQBaseDao.Query(sql).Tables[0];
DataRow dr = dt.NewRow();
dr["Contract_No"] = "0";
dr["Contract_Name"] = "";
dt.Rows.InsertAt(dr, 0);
ComboBox1.DataSource = dt;
ComboBox1.ValueMember = "Contract_No";
ComboBox1.DisplayMember = "Contract_Name";

上一篇:将小度WiFi改造为无线网卡(小度WiFi能够接收WiFi信号)


下一篇:oracle 表的管理(数据类型,表创建删除,数据CRUD 操作)