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";
时间: 2024-11-05 16:38:44