Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            self_study ss = new self_study();

            ss.Show();
            this.Hide();
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox2.Text != null && textBox1.Text != null)
            {
                string add = "insert into dbo.ques_ans(question,Answer,keyword)values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "')";
                con.Open();
                SqlCommand sqlcom = new SqlCommand(add, con);
                sqlcom.ExecuteNonQuery();
                con.Close();

                string delete = "update dbo.tb_self_study set flag=0 where question='" + textBox1.Text + "'";
                con.Open();
                SqlCommand cmd = new SqlCommand(delete, con);
                cmd.ExecuteNonQuery();
                con.Close();

                self_study ss = new self_study();
                ss.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Enter Question and Answer");
            }
        }