Combox用ValueMember 之后再添加一项

it2022-05-09  33

在Combox插入“请选择”:DataSetQueryFill(ds, "UNIT_REL_PARM", "select UNIT_CODE,ltrim(str(UNIT_CODE))+' '+UNIT_NAME as UNIT_NAME from UNIT_REL_PARM order by UNIT_CODE", null, true);DataTable dt =ds.Tables["UNIT_REL_PARM"];

DataRow dr= dt.NewRow();dr[0] = "0";dr[1] = "请选择";//插在第一位dt.Rows.InsertAt(dr, 0);

comboBox.DataSource = dt;comboBox.DisplayMember = "UNIT_NAME";comboBox.ValueMember = "UNIT_CODE";

转载于:https://www.cnblogs.com/tuyile006/archive/2006/11/27/574473.html

相关资源:数据结构—成绩单生成器

最新回复(0)