예제 #1
0
        private void addTeamButton_Click(object sender, EventArgs e)
        {
            try
            {
                AddValues sql = new AddValues();
                string sqlQuery = String.Format("INSERT INTO teams VALUES ('{0}','{1}');",
                    textBox1.Text, textBox2.Text);
                sql.addMatchResults(sqlQuery);

            }
            catch (Exception msg)
            {
                // something went wrong, and you wanna know why
                MessageBox.Show(msg.ToString());
                throw;
            }
            this.Close();
        }
예제 #2
0
        private void addResult_Click(object sender, EventArgs e)
        {

            try
            {
                AddValues sql = new AddValues();
                string sqlQuery = String.Format("INSERT INTO matches VALUES ('{0}','{1}', '{2}', {3}, {4}, CURRENT_DATE);",
                    leagueNo.Text, comboBox1.Text, comboBox2.Text, scoreHome.Text, scoreAway.Text);
                sql.addMatchResults(sqlQuery);
                
            }
            catch (Exception msg)
            {
                // something went wrong, and you wanna know why
                MessageBox.Show(msg.ToString());
                throw;
            }
            this.Close();
        }