你设置
ComboBox1.ValueMember = "Name";还必须保证你的this.dataSet1.Tables[1]已经填充了数据!

解决方案 »

  1.   

    不行呀.!我急!this.myAdapter5 = new SqlDataAdapter("SELECT * FROM School",this.sqlConnection1);
    this.myAdapter5.Fill(dataSet1,"Department");
    this.comboBox1.DataSource = this.dataSet1.Tables["Department"];
    this.comboBox1.DisplayMember = "Name";
    this.comboBox1.ValueMember = "Name";
    启动后,comboBox里面有Name列的值,但是选择一个值后,comboBox.SelectIndex仍是-1,怎么办呀?
      

  2.   

    你在this.comboBox1.ValueMember = "Name";后面加上if (this.comboBox1.selectedIndex>this.comboBox1.Items.Count-1)
    {
      this.comboBox1.selectedIndex =-1;
    }
    试验一下
      

  3.   

    你的Items属性值始终为0,索引你选择回来的为-1;要将Combobox.items.add()加入你的Items选项就可
      

  4.   

    修改:
    你的Items的Count属性值始终为0,索引你选择回来的为-1;