private void button5_Click(object sender, EventArgs e) { Form15 frm11 = new Form15(); this.Hide(); frm11.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); string Query = "insert into RubricLevel(RubricId,Details,MeasurementLevel) values('" + idno + "','" + txtDetail.Text.ToString() + "','" + cmbRubricId.Text.ToString() + "')"; SqlConnection myconnection2 = new SqlConnection(conn); SqlCommand MyCommand2 = new SqlCommand(Query, myconnection2); SqlDataReader MyReader2; myconnection2.Open(); MyReader2 = MyCommand2.ExecuteReader(); MessageBox.Show("Data inserted Successfully!"); Form15 frm2 = new Form15(); this.Hide(); frm2.Show(); }