comboBox1.text显示的是xbdm即1或2,我想让它显示的是xbmc即男或女,请问该怎样做?
this.comboBox1.DataBindings.Add(new System.Windows.Forms.Binding( "Text ", this.bmkBindingSource, "XBDM ", true));
this.comboBox1.DataSource = this.xbdmBindingSource;
this.comboBox1.DisplayMember = "xbmc ";
this.comboBox1.Name = "comboBox1 ";
this.comboBox1.ValueMember = "xbdm ";
性别代码表如下:
xbdm xbmc
1 男
2 女
照上面的设定,comboBox1.text显示的是xbdm即1或2,我想让它显示的是xbmc即男或女,请问该怎样做?
------解决方案--------------------switch "comboBox1.text "
{
case "1 ":
comboBox1.text= "男 ";
break;
case "2 "
comboBox1.text= "女 ";
break;
}
------解决方案-------------------- 修改sql语句
------解决方案--------------------修改sql语句
------解决方案--------------------如果用bind的话可以在bind前做处理