private void btnGenerateFixtures_Click_1(object sender, EventArgs e) { //check that there are 20 teams //check no games have been played //generate fixtures DataSet ds = new DataSet(); ds = Fixtures.genFixtures(ds); int fixId = 1; for (int i = 0; i < ds.Tables["fx"].Rows.Count; i++) { Fixtures.insFixture(fixId, Convert.ToInt32(ds.Tables["fx"].Rows[i][0]), Convert.ToInt32(ds.Tables["fx"].Rows[i][1])); fixId++; hsbProgress.Value++; } //Display confirmation message MessageBox.Show("Fixtures generated", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); }