示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            AddSickForm form = new AddSickForm();

            form.ShowDialog();
            string surname = form.GetSurname();
            string name    = form.GetName();
            string patr    = form.GetPatr();
            string num     = form.GetNumber();
            string seria   = form.GetSeria();
            string path    = form.GetPath();

            LoadGrid();
            if (surname != "" && name != "" && patr != "" && num != "" && seria != "")
            {
                try
                {
                    oleDbConnection1.Open();

                    oleDbDataAdapter1.InsertCommand.CommandText = "INSERT INTO [Больные] (Фамилия, Имя, Отчество, [Номер паспорта], [Серия паспорта], фото) VALUES ('" + surname + "', '" + name + "', '" + patr + "', '" + num + "', '" + seria + "', '" + path + "')";

                    oleDbDataAdapter1.InsertCommand.ExecuteNonQuery();
                }
                catch (Exception)
                {
                };
            }
            oleDbConnection1.Close();
            UpdateGrid();
        }