private void btnRemoveSelectedProduct_Click(object sender, EventArgs e) { if (lbxProductList.SelectedIndex > -1) { int prodId = pList[lbxProductList.SelectedIndex].Id; db.DeleteConditionFromTable("products", "productId =" + prodId); parent.updateProductLists(); this.Close(); } }