DataTable dt; // DataTable to store all the data // ==> Constructor public GameForm_PlayGame() { InitializeComponent(); sql = new MySQL_Data_Base.MySqlDB(); obj = new GameForm_OptionGamForm(); dt = new DataTable(); // ==> Get catagory of quiz questions catagory = obj.getCatagory(); // ==> get all the questions of specific type from DB and store in Data Table dt = sql.getAllQuestionByCatagory(catagory); totalQues = dt.Rows.Count; // storte the total number of questions // ==> Initializer userAns = ""; correctAns = ""; totalCorrectAns = 0; totalscore = 0; timeLeft = 15; // for Displaying Time Left QuestionID = 1; }
// navigate to Option form private void OptionGameBtn_Click(object sender, EventArgs e) { GameSubForms.GameForm_OptionGamForm form = new GameSubForms.GameForm_OptionGamForm(); this.Hide(); form.Show(); }