写在comboBox控件的SelectionChangeCommitted事件里,
SqlConnection con = new SqlConnection("连接字符串");
comboBox1.Items.Clear();//如果不每次清楚,每次查出的结果会累加
SqlCommand cmd = new SqlCommand("select 列名 from 表 where 列名 = '" + comboBox1.Text.Trim() + "'", con);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);
//将查询到的结果放入comboBox1
foreach (DataRow row in ds.Tables[0].Rows)
{
comboBox1.Items.Add(row[0].ToString());
}