private void button2_Click(object sender, EventArgs e) { Form16 f = new Form16(); this.Hide(); f.Show(); }
private void button2_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(conn); con.Open(); int id = int.Parse(dataGridView1.Rows[row].Cells[0].Value.ToString()); SqlCommand command = new SqlCommand("delete from RubricLevel where Id = '" + id + "'", con); command.ExecuteNonQuery(); MessageBox.Show("Deleted sucesfully!"); Form16 frm = new Form16(); this.Hide(); frm.Show(); }
private void button1_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(conn); con.Open(); string id = "Select id from Rubric where Details='" + cmbRubricId.Text.ToString() + "'"; SqlCommand cmd = new SqlCommand(id, con); var r = cmd.ExecuteReader(); r.Read(); int idno = r.GetInt32(0); SqlConnection connection = new SqlConnection(conn); SqlCommand exe = new SqlCommand("Update RubricLevel set RubricId='" + idno + "' , Details='" + txtDetail.Text.ToString() + "',MeasurementLevel='" + cmbMeasurementLevel.Text.ToString() + "' where Id='" + ID + "'", connection); connection.Open(); exe.CommandType = CommandType.Text; exe.ExecuteNonQuery(); MessageBox.Show("UPdated Successfully!!"); Form16 frm3 = new Form16(); this.Hide(); frm3.Show(); }