private void reloadB_Click(object sender, EventArgs e) { il.image_load(mobileNoL.Text, studentPB); }
private void studentDGV_CellContentClick(object sender, DataGridViewCellEventArgs e) { int row = e.RowIndex; int column = 0; if (row > -1) { string sid = studentDGV[column, row].Value.ToString(); try { con.Open(); MySqlCommand cmd = new MySqlCommand("SELECT s.hall_std_id, s.session, s.class_roll, s.registration_no, s.name, s.f_name, s.m_name, s.address, s.sex, s.religion,s.degree, s.mobile, s.phone, s.email, s.blood_group, s.alloted_room, h.hall_name, d.dept_name,f.faculty_name ,q.qouta_name, u.name AS Added_By,s.status FROM student_info as s,dept_info as d,faculty_info as f,hall_info as h,qouta as q ,user as u where s.dept_id = d.dept_id and s.faculty_id = f.faculty_id and s.hall_id = h.hall_id and s.qouta_id = q.qouta_id and s.added_by = u.user_id and s.hall_std_id =" + sid, con); MySqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { studentIdL.Text = reader.GetString("hall_std_id").ToString(); sessionCB.SelectedItem = reader.GetString("session").ToString(); classRollTB.Text = reader.GetString("class_roll").ToString(); registrationTB.Text = reader.GetString("registration_no").ToString(); studentNameTB.Text = reader.GetString("name").ToString(); fatherNameTB.Text = reader.GetString("f_name").ToString(); motherNameTB.Text = reader.GetString("m_name").ToString(); addressTB.Text = reader.GetString("address").ToString(); sexCB.SelectedItem = reader.GetString("sex").ToString(); religionTB.Text = reader.GetString("religion").ToString(); degreeCB.SelectedItem = reader.GetString("degree").ToString(); mobileTB.Text = reader.GetString("mobile").ToString(); phoneTB.Text = reader.GetString("phone").ToString(); emailTB.Text = reader.GetString("email").ToString(); bloodGroupCB.SelectedItem = reader.GetString("blood_group").ToString(); roomTB.Text = reader.GetString("alloted_room").ToString(); hallNameCB.SelectedItem = reader.GetString("hall_name").ToString(); deptNameCB.SelectedItem = reader.GetString("dept_name").ToString(); facultyNameCB.SelectedItem = reader.GetString("faculty_name").ToString(); qoutaCB.SelectedItem = reader.GetString("qouta_name").ToString(); addedByL.Text = reader.GetString("Added_By").ToString(); int status = reader.GetInt32("status"); if (status == 0) { currentStudentRB.Checked = true; } else { oldStudentRB.Checked = true; } il.image_load(reader.GetString("mobile"), studentPB); } reader.Close(); con.Close(); } catch (Exception ex) { MessageBox.Show("Error occured. Message - " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); con.Close(); } } }