private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { PermissionCheck newCheck = new PermissionCheck(); DataTable newtable = new DataTable(); newtable = newCheck.selectInfo(comboBox1.Text); txIDNum.Text = newtable.Rows[0][0].ToString(); txName.Text = newtable.Rows[0][1].ToString(); if (newtable.Rows[0][2].ToString() == "男") { rdBtnM.Checked = true; } else { rdBtnF.Checked = true; } txAge.Text = newtable.Rows[0][3].ToString(); txTell.Text = newtable.Rows[0][4].ToString(); }