日期:2014-05-18  浏览次数:20822 次

为什么不执行呀
Combox SelectValueChanged事件
  private void ComboxSelectValueChanged_Click(object sender, EventArgs e)
  {
  try
  {
  Cursor = Cursors.WaitCursor;
  //String sqlStr = "select ContractNo from Contract " +
  // "where ClientNo='" + this.CustomeNortextBox3.Text + "'and ContractType='" + this.comboBox3.Text + "'";

  String sqlStr = "select ContractNo from Contract " +
  "where ClientNo='" + this.CustomeNortextBox3.Text.Trim() + "'";
  DataSet userDataset = bussiness.ExecuteDetset(sqlStr);
          下面的代码怎么不执行呀,郁闷  
  this.ContractComboBox5.DataSource = userDataset.Tables[0];
  this.ContractComboBox5.DisplayMember = "ContractNo";
  this.ContractComboBox5.ValueMember = "ContractNo";
  this.ContractComboBox5.SelectedValue = 1;
   


  }
  catch (Exception ex)
  {
  DisplayErrors(ex);
  }
  finally
  {
  Cursor = Cursors.Arrow;
  }

------解决方案--------------------
是不是出现异常了啊
------解决方案--------------------
学习
------解决方案--------------------
没绑定阿 唉
------解决方案--------------------
bussiness 呢??
------解决方案--------------------
你凭什么说没执行呢?debug跟踪了?


------解决方案--------------------
调试一下不就知道了吗
------解决方案--------------------
看不出什么原因,是不是bus..那里出錯啊.
------解决方案--------------------
this.ContractComboBox5.DataSource = userDataset.Tables[0]; 
this.ContractComboBox5.DisplayMember = "ContractNo"; 
this.ContractComboBox5.ValueMember = "ContractNo"; 
加上下面这句:
this.ContractComboBox5.DataBind();