private void Delete2_Click(object sender, EventArgs e)//要素削除 本棚の場所 { string deletequery; int counter = 0; counter = SQLiteConnect.counterID2("place", beforeListView1ID, "bookShelf", beforeListview2ID); if (counter != 0) { MessageBox.Show("データが" + counter + "件存在するため、削除できません。", "警告", MessageBoxButtons.OK); return; } DialogResult res = MessageBox.Show(beforeListview2Title + "を削除しますか?", "削除確認", MessageBoxButtons.YesNo); if (res == DialogResult.Yes) { deletequery = "delete from t_house_shelf where place_ID =" + beforeListView1ID + " and bookShelf_ID = " + beforeListview2ID; SQLiteConnect.Excute(deletequery); Listview2.Items.Clear(); SQLiteConnect.lording(ref Listview2, "select bookShelf_ID,shelf_name from t_house_shelf where place_ID = " + beforeListView1ID, "bookShelf_ID", "shelf_name"); Textbox2.Clear(); } }