private void btnConfirm_Click_1(object sender, EventArgs e) { AdminDB obj = new AdminDB( tbName.Text, tbSername.Text, tbMiddleName.Text, tbLogin.Text, tbPassword.Text, tbRegDate.Text = DateTime.Now.ToString(""), tbComment.Text, Convert.ToInt32(((KeyValuePair <string, string>)cbGroup.SelectedItem).Key) ); // Запишем в базу obj.AddToDB(); // Обновим dgv MainForm main_fm = (MainForm)Application.OpenForms["MainForm"]; main_fm.UpdateDGV_Users(); this.Close(); }