コード例 #1
0
        public void E_Delete()
        {
            string     query = "delete Question_sheet where question_num ='" + Q_no + "'";
            SqlCommand SC    = new SqlCommand(query, Connection_cls.Get());

            SC.ExecuteNonQuery();
        }
コード例 #2
0
        // edit english questions
        public void E_EDIT()
        {
            string     query = "Update English_Question_sheet set Question ='" + new_Question + "', option_a='" + a + "', option_b='" + b + "', option_c='" + c + "',option_d = '" + d + "',correct_ans ='" + Correct_ans + "' where Question_num ='" + Q_no + "'";
            SqlCommand SC    = new SqlCommand(query, Connection_cls.Get());

            SC.ExecuteNonQuery();
        }
コード例 #3
0
        public void E_ADD()
        {
            string     query = "insert into English_Question_sheet values('" + new_Question + "','" + a + "','" + b + "','" + c + "','" + d + "','" + Correct_ans + "')";
            SqlCommand SC    = new SqlCommand(query, Connection_cls.Get());

            SC.ExecuteNonQuery();
        }
コード例 #4
0
        public void ADD()

        {
            string     query = "insert into tbl_Login values('" + Login_ID + "','" + Login_Pass + "','" + T_Marks + "','" + Type + "') ";
            SqlCommand SC    = new SqlCommand(query, Connection_cls.Get());

            SC.ExecuteNonQuery();
        }
コード例 #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            SqlDataAdapter adpt = new SqlDataAdapter("select * from Question_sheet", Connection_cls.Get());
            DataTable      dt   = new DataTable();

            adpt.Fill(dt);
            dataGridView1.DataSource = dt;
            // Connection_cls.Get().Close();
        }
コード例 #6
0
        //search for English Questions
        public void E_Search()
        {
            string     query = "select * from English_Question_sheet where Question_num ='" + Q_no + "'";
            SqlCommand SC    = new SqlCommand(query, Connection_cls.Get());


            SqlDataReader sdr = SC.ExecuteReader();

            while (sdr.Read())
            {
                new_Question = sdr["Question"].ToString();
                a            = sdr["option_a"].ToString();
                b            = sdr["option_b"].ToString();
                c            = sdr["option_c"].ToString();
                d            = sdr["option_d"].ToString();
                Correct_ans  = sdr["correct_ans"].ToString();
            }
            sdr.Close();
        }
コード例 #7
0
        public void show_ques()
        {
            string     query = "select * from English_Question_sheet where Question_num = '" + Question_num + "'";
            SqlCommand SC    = new SqlCommand(query, Connection_cls.Get());

            SC.ExecuteNonQuery();

            SqlDataReader sdr = SC.ExecuteReader();

            while (sdr.Read())
            {
                Question    = (string)sdr["Question"];
                option_a    = (string)sdr["option_a"];
                option_b    = (string)sdr["option_b"];
                option_c    = (string)sdr["option_c"];
                option_d    = (string)sdr["option_d"];
                correct_ans = (string)sdr["correct_ans"];
            }
            sdr.Close();
        }
コード例 #8
0
        public SqlConnection Request(SqlConnection req)
        {
            SqlConnection con = Connection_cls.Get(req);

            return(con);
        }