Exemple #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            Class1.task10(listBox2, listBox3, listBox4, 9);
            Form29 f = new Form29();

            this.Hide();
            f.ShowDialog();
            Close();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            string SqlText = "INSERT INTO [Personal] ([Personal_ID], [Surname],[Posada_ID],[KilkistPolotiv],[Vik]) VALUES (1,'surname', 1, '1','20') ";
            Form29 f       = new Form29(); // створити екземпляр вікна

            if (f.ShowDialog() == DialogResult.OK)
            {
                // сформувати SQL-рядок
                SqlText = "INSERT INTO [Personal] ([Personal_ID], [Surname],[Posada_ID],[KilkistPolotiv],[Vik]) VALUES (";
                SqlText = SqlText + "\'" + f.textBox1.Text + "\', ";
                SqlText = SqlText + "\'" + f.textBox2.Text + "\', ";
                SqlText = SqlText + "\'" + f.textBox3.Text + "\')";
                SqlText = SqlText + "\'" + f.textBox4.Text + "\')";
                SqlText = SqlText + "\'" + f.textBox5.Text + "\')";



                // виконати SQL-команду
                MyExecuteNonQuery(SqlText);
                // відобразати таблицю Source
                Personal();
            }
        }