public int addFeedback(MySqlConnection conn, CreateFeedback sendData) { string sql = "INSERT INTO feedback (templateID ,lastName, firstName, address, position, email,phoneNo, comment)" + "VALUE('" + sendData.InterviewerChosenTemplateID + "','" + sendData.IntervieweeLastName + "' , '" + sendData.IntervieweeFirstName + "', '" + sendData.IntervieweeAddress + "' , '" + sendData.IntervieweePosition + "','" + sendData.IntervieweeEmail + "'," + sendData.IntervieweePhoneNo + ",'" + sendData.InterviewerComment + "')"; MySqlCommand sqlComm = new MySqlCommand(sql, conn); return(sqlComm.ExecuteNonQuery()); }
private void button2_Click(object sender, EventArgs e) { DbConnection dbConn = new DbConnection(); dbConn.connect(); CreateFeedback sendInterviewer = new CreateFeedback(); sendInterviewer.InterviewerChosenTemplateID = int.Parse(idSearchtxtbox.Text); sendInterviewer.IntervieweeLastName = txt1.Text; sendInterviewer.IntervieweeFirstName = txt2.Text; sendInterviewer.IntervieweeAddress = txt3.Text; sendInterviewer.IntervieweePosition = txt4.Text; sendInterviewer.IntervieweeEmail = txt5.Text; sendInterviewer.IntervieweePhoneNo = int.Parse(txt6.Text); sendInterviewer.InterviewerComment = txt7.Text; SaveFeedback newTxtbox1 = new SaveFeedback(); int recordCnt = newTxtbox1.addFeedback(dbConn.getConn(), sendInterviewer); MessageBox.Show(recordCnt + " new details has been inserted !!"); }