private void cboDepart_SelectedIndexChanged(object sender, EventArgs e) { using (gjtEmrPatients.emrPatients ep = new gjtEmrPatients.emrPatients()) { DataTable dt = new DataTable(); dt.TableName = "getdoc"; DataSet dst = new DataSet(); if (cboDepart.SelectedValue.ToString() != "$") { dst = ep.GetDoctorListByDepartment(cboDepart.SelectedValue.ToString()); dt = dst.Tables[0]; DataRow dr = dt.NewRow(); dr["ysm"] = "-----"; dr["ysbm"] = "$"; dt.Rows.InsertAt(dr, 0); cboDoctor.DataSource = dt; cboDoctor.DisplayMember = "ysm"; cboDoctor.ValueMember = "ysbm"; cboDoctor.SelectedIndex = 0; } else { dst = ep.GetDoctorList(); dt = dst.Tables[0]; DataRow dr = dt.NewRow(); dr["ysm"] = "全部"; dr["ysbm"] = "$"; dt.Rows.InsertAt(dr, 0); cboDoctor.DataSource = dt; cboDoctor.DisplayMember = "ysm"; cboDoctor.ValueMember = "ysbm"; cboDoctor.SelectedIndex = 0; } } }