private void button1_Click(object sender, EventArgs e) { SqlConnection connn = new SqlConnection(conn); connn.Open(); string idd = "Select id from Rubric where Details='" + cmbRubricId.Text.ToString() + "'"; SqlCommand cmdd = new SqlCommand(idd, connn); var rd = cmdd.ExecuteReader(); rd.Read(); int iddno = rd.GetInt32(0); SqlConnection connection = new SqlConnection(conn); SqlCommand exe = new SqlCommand("Update AssessmentComponent set Name='" + txtName.Text.ToString() + "',RubricId='" + iddno + "',TotalMarks='" + txtTotalMarks.Text.ToString() + "',DateUpdated='" + dtUpdate.Value.Date + "',AssessmentId='" + cmbAssessmentId.Text.ToString() + "' where id ='" + ID + "'", connection); connection.Open(); exe.CommandType = CommandType.Text; exe.ExecuteNonQuery(); MessageBox.Show("UPdated Successfully!!"); Form22 frm6 = new Form22(); this.Hide(); frm6.Show(); }
private void button2_Click(object sender, EventArgs e) { Form22 frm5 = new Form22(); this.Hide(); frm5.Show(); }
private void button2_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(conn); con.Open(); int id = int.Parse(AssessmentDetail.Rows[row].Cells[0].Value.ToString()); SqlCommand command = new SqlCommand("delete from AssessmentComponent where Id = '" + id + "'", con); command.ExecuteNonQuery(); MessageBox.Show("Deleted sucesfully!"); Form22 frm = new Form22(); this.Hide(); frm.Show(); }