string sSql = "Select id from Master.Materialname where Material = '" +
comboBox3.SelectedValue + "'";
SqlCommand cmd = new SqlCommand(sSql,objConn1);
int mid = Convert.ToInt32(cmd.ExecuteScalar());
string reffSql = "Select Process from Master.ProductionProcess where id = '" + mid + "'";
SqlCommand rcmd = new SqlCommand(reffSql, objConn1);
comboBox4.SelectedValue = Convert.ToString(rcmd.ExecuteScalar());
我用过以上一个但不工作