private void button1_Click(object sender, EventArgs e) { string path = openFileDialog1.FileName; //путь к файлу string selectedState = comboBox1.SelectedItem.ToString(); //выбор из combobox string name_picture = Path.GetFileNameWithoutExtension(openFileDialog1.FileName); ConnDatabase bd = new ConnDatabase(); if (bd.insertInGallery(path, selectedState, name_picture)) { listView1.Clear(); updateListView(); comboBox1.Enabled = false; button1.Enabled = false; } else { MessageBox.Show("Не удалось добавить картинку"); } }