combobox数据绑定
2008-11-29 22:22
176 查看
Code
public void fill_combobox_reader(string sql,ComboBox combo,string tablename,string read_value)
{
co.co();
SqlDataAdapter adapter = new SqlDataAdapter(sql, co.conn);
DataSet ds = new DataSet();
adapter.Fill(ds,tablename);
combo.DataSource = ds.Tables[tablename];
combo.DisplayMember = read_value;
combo.ValueMember = read_value;
co.dis_co();
}
public void fill_combobox_reader(string sql,ComboBox combo,string tablename,string read_value)
{
co.co();
SqlDataAdapter adapter = new SqlDataAdapter(sql, co.conn);
DataSet ds = new DataSet();
adapter.Fill(ds,tablename);
combo.DataSource = ds.Tables[tablename];
combo.DisplayMember = read_value;
combo.ValueMember = read_value;
co.dis_co();
}
相关文章推荐
- datatable绑定comboBox显示数据[C#]
- ComboBox的数据绑定(新入门,大神勿喷)
- 解决 ComboBox数据绑定的时候也触发SelectedIndexChanged
- comboBox绑定DataSet数据
- 多个ComboBox 绑定同一个数据源时,数据联动
- 从后台绑定数据到ligerui 的comboBox下拉框组件
- 下拉框(ComboBox)数据绑定时触发SelectedIndexChanged事件的初步解决
- Winform开发之ComboBox和ComboBoxEdit控件绑定key/value数据
- VS2015中DataGridView的DataGridViewComBoboxCell列值无效及数据绑定错误的解决方法
- easyui propertyGrid combobox类型的editor数据绑定
- ComboBox应该如何绑定数据
- DEV ImageComboBoxItem 绑定数据
- C# 程序中如何向(DEV)ComboBoxEdit控件中添加下拉列表的值不使用数据绑定,就是使用代码添加
- winform中ComboBox的数据绑定方法
- ComboBox前台xaml绑定数据
- ComboBox绑定DataTable数据,用户选中项后触发事件异常。
- ComboBox 数据绑定问题
- ComboBox 控件绑定数据和获取选中的数据
- WPF学习笔记:ComboBox的数据绑定
- DataGridView中comboBox数据绑定的问题