//绑定 SelectedValue 是关键
//要绑定一个工程单位(ppm,cm,m/s,...),下拉列表
string strTab = "cfg_eng_unit";
string strSql = "SELECT eng_unit_id,eng_unit FROM cfg_eng_unit;";
DataSet ds_Unit = MySql.GetDataFromTable(strTab, strSql, ref _conn);
//GetDataFromTable是我取数据库集的一个方法
comUnit.DataSource = ds_Unit.Tables[0].DefaultView;
comUnit.DisplayMember = "eng_unit";
comUnit.ValueMember = "eng_unit_id";
string strTab1 = "cfg_point_current";
string strSql1= "SELECT a.eng_unit_id,b.eng_unit,a.* FROM cfg_point_current a "+
" left join cfg_eng_unit b on a.eng_unit_id=b.eng_unit_id;";
DataSet ds1 = MySql.GetDataFromTable(strTab1, strSql1, ref _conn);
DataTable dt = ds1.Tables[0];
comUnit.DataBindings.Add("SelectedValue", dt, "eng_unit_id");//关键句