private void Form1_Load(object sender, EventArgs e)
        {
            DatabaseConnection.getconnection();

            //check options
            radioButtoncheck();
            //
            b = true;
            RecordQuestion r = DatabaseConnection.getquestions();

            DatabaseConnection.n++;
            labelID.Text   = "" + r.questionId;
            labelName.Text = r.questions;
            labelOa.Text   = r.qOpa;
            labelOb.Text   = r.qOpb;
            LabelOc.Text   = r.qOpc;
            qOpANS         = r.qOpANS;

            label5.Text = DatabaseConnection.stnameG;

            if (DatabaseConnection.testcomplete)
            {
                panel1.Visible  = true;
                button1.Enabled = false;

                totalm = totalq * 10;
                int      per  = (Int32.Parse(obmarks.Text) * 100) / totalm;
                int      incq = totalq - correctq;
                DateTime d    = DateTime.Now;
                string   date = d.ToString();

                DatabaseConnection.insertResult(DatabaseConnection.stnameG, DatabaseConnection.emailadressG, (totalm).ToString(), obmarks.Text, (per).ToString(), (totalq).ToString(), (correctq).ToString(), (incq).ToString(), date);
            }
        }
        public static RecordQuestion getquestions()
        {
            string query = "select * from question where questionid=" + n;

            con.Open();

            OleDbCommand    com  = new OleDbCommand(query, DatabaseConnection.con);
            OleDbDataReader read = com.ExecuteReader();
            RecordQuestion  rec  = new RecordQuestion();

            testcomplete = true;
            if (read.Read())
            {
                rec.questionId = read.GetInt32(0);
                rec.questions  = read.GetString(1);
                rec.qOpa       = read.GetString(2);
                rec.qOpb       = read.GetString(3);
                rec.qOpc       = read.GetString(4);
                rec.qOpANS     = read.GetString(5);
                testcomplete   = false;
            }
            con.Close();



            return(rec);
        }