//function called when submit button is clicked private void btnSubmitform_Click(object sender, EventArgs e) { bool result; name = tbFname.Text + " " + tbLname.Text; result = validation(); if (result == true) { try { if (cbReferences.Text == "Others") { query = "insert into student(stud_photo,stud_name,stud_address,stud_pno,stud_cell,stud_email,stud_gender,stud_dob,stud_age,stud_educationpersuing,stud_branch,stud_college,stud_courseSelected,stud_courseFee,stud_details_of_work,stud_reference,stud_doj,stud_place,stud_idproof) values(@IMG,'" + name + "','" + tbAddress.Text + "','" + tbPhone.Text + "','" + tbCell.Text + "','" + tbEmail.Text + "','" + radioGender + "','" + dtpDOB.Text + "','" + tbAge.Text + "','" + tbEducationpersuing.Text + "','" + tbBranch.Text + "','" + tbCollege.Text + "','" + cbCourseSelected.Text + "','" + tbCoursefee.Text + "','" + tbDetailsOfWork.Text + "','" + tbOthers.Text + "','" + dtpDoj.Text + "','" + tbPlace.Text + "',@IMG2)"; } else { query = "insert into student(stud_photo,stud_name,stud_address,stud_pno,stud_cell,stud_email,stud_gender,stud_dob,stud_age,stud_educationpersuing,stud_branch,stud_college,stud_courseSelected,stud_courseFee,stud_details_of_work,stud_reference,stud_doj,stud_place,stud_idproof) values(@IMG,'" + name + "','" + tbAddress.Text + "','" + tbPhone.Text + "','" + tbCell.Text + "','" + tbEmail.Text + "','" + radioGender + "','" + dtpDOB.Text + "','" + tbAge.Text + "','" + tbEducationpersuing.Text + "','" + tbBranch.Text + "','" + tbCollege.Text + "','" + cbCourseSelected.Text + "','" + tbCoursefee.Text + "','" + tbDetailsOfWork.Text + "','" + cbReferences.Text + "','" + dtpDoj.Text + "','" + tbPlace.Text + "',@IMG2)"; } con.Open(); cmd = new MySqlCommand(query, con); cmd.Parameters.Add(new MySqlParameter("@IMG2", idproofbt)); cmd.Parameters.Add(new MySqlParameter("@IMG", imagebt)); cmd.ExecuteNonQuery(); Payments payments = new Payments(index); payments.Show(); } catch (Exception ex) { MessageBox.Show("" + ex.Message); } finally { con.Close(); } } }
private void viewPreviousDetailsToolStripMenuItem_Click(object sender, EventArgs e) { Payments payments = new Payments(18); payments.Show(); }