// 
            // comboBox1
            // 
            this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboBox1.FormattingEnabled = true;
            this.comboBox1.Items.AddRange(new object[] {
            "山东",
            "辽宁",
            "四川",
            "北京",
            "上海"});后面还有combobox需要根据省份的选择相应的变化.怎么实现呢?

解决方案 »

  1.   

    private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
            {
                if (comboBox1.SelectedIndex>-1)
                {
                    SqlConnection con = new SqlConnection(conn);
                    con.Open();
                    SqlCommand cmd = new SqlCommand("select * from Tb where name='" + comboBox1.Text+ "'", con);
                    SqlDataAdapter sda = new SqlDataAdapter(cmd);             
                    DataTable dt = new DataTable();
                    sda.Fill(dt);
                }
            }
      

  2.   

    SelectedIndexChanged事件中写
    改变ComboBox数据源~
      

  3.   

    这个主要用写SQL语句了,然后绑定下拉框