Winform里有关Combobox的一些操作
来源:互联网 发布:iis7端口设置 编辑:程序博客网 时间:2024/05/02 02:29
读取其显示值(text):this.cobobox1.SelectedText.ToString()
与查询数据库结果绑定:
//sql语句
string sql_ShuM = " select " + changyongziliaoEntity.ID + " as ID "
+ "," + changyongziliaoEntity.cMC + " as 属名 "
+ " from " + changyongziliaoEntity.tName
+ " where " + changyongziliaoEntity.nZT + "=1 and " + changyongziliaoEntity.cLB + "='shu'";
OleDbDataAdapter oleZhongM = new OleDbDataAdapter(sql_ShuM, oleCon);
DataTable dtShuM = new DataTable();
oleZhongM.Fill(dtShuM);
this.comboBox2.DataSource = dtShuM.DefaultView;
this.comboBox2.DisplayMember = "属名";
this.comboBox2.ValueMember = "ID";
给ComboBox赋值:
this.diqu_comboBox.Items.Add("--请选择--");
this.diqu_comboBox.Items.Add("--湛江市--");
this.diqu_comboBox.Items.Add("--廉江市--");
this.diqu_comboBox.Items.Add("--雷州市--");
this.diqu_comboBox.Items.Add("--徐闻县--");
this.diqu_comboBox.Items.Add("--吴川市--");
this.diqu_comboBox.Items.Add("--遂溪县--");
- Winform里有关Combobox的一些操作
- # winform comboBox动态下拉列表,comboBox动态绑定数据库里的数据
- c# winform comboBox的常用一些属性和用法
- 有关HBase的一些操作
- 有关XML的一些操作
- 有关字符串的一些操作
- winform中一些基本操作的代码
- winform 关于DataGridView的一些操作
- c# winform 关于DataGridView的一些操作
- c# winform 关于DataGridView的一些操作
- c# winform 关于DataGridView的一些操作
- c# winform 关于DataGridView的一些操作
- c# winform 关于DataGridView的一些操作
- c# winform 关于DataGridView的一些操作
- Sql中有关xml的一些操作
- 有关linux的一些基本操作
- 有关vs2008连接数据库的一些操作
- 有关树二叉树的一些操作
- RSS阅读器的实现
- hdu 1569 最大流建图
- nfs:server is not responding,still tryin
- USB驱动程序
- 单例模式的常见应用场景
- Winform里有关Combobox的一些操作
- PHP中获取当前页面的完整URL
- linux下启动和关闭网卡命令
- Jsoup类
- Android开源项目-个性化控件篇
- hbase建内存表
- POJ2762 Going from u to v or from v to u? 强连通 Tarjan缩点+拓扑排序topsort
- dhtmlxCombo(select非数据库取值),导出excel功能,利用form表单传值getActualValue()到后台判断
- Android四大组件之一之内容提供者ContentProvider