1.绑定数据
public static DataTable GetAreaDataTable()
{
string sqlStr = "select type from TypeList where ID=3";
DataBase db = new DataBase();
DataTable dt = db.GetDataTable(sqlStr);
return dt;
}
private void LoadComboBoxEdit()
{
this.comboBoxEdit1.Properties.NullText = "请选择...";
DataTable dt = GetAreaDataTable();
for (int i = 0; i < dt.Rows.Count; i++)
{
comboBoxEdit1.Properties.Items.Add(dt.Rows[i]["type "].ToString());
}
}

© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END








暂无评论内容