Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            con.Open();
            SqlCommand cmd = new SqlCommand("ins", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@t_name", comboBox1.SelectedItem);
            cmd.Parameters.AddWithValue("@lecture", comboBox2.SelectedItem);
            cmd.Parameters.AddWithValue("@day", comboBox3.SelectedItem);
            cmd.Parameters.AddWithValue("@subject", listBox1.SelectedItem);
            cmd.ExecuteNonQuery();
            cmd.Dispose();
            con.Close();
            comboBox1.SelectedIndex = -1;
            comboBox2.SelectedIndex = -1;
            comboBox3.SelectedIndex = -1;
            listBox1.SelectedIndex  = -1;

            Show_t_time_table obj = new Show_t_time_table();

            obj.Show();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Show_t_time_table obj = new Show_t_time_table();

            obj.Show();
        }