private void btnAddTag_Click(object sender, EventArgs e) { // TODO: make a funcion to comport the next if statement and change the 'stringsToBeAdded' function if (cbbVideoTags.Text.Length == 0) { btnAddCategory.Enabled = false; } if (verifyStringToBeAdded(cbbVideoTags.Text,lbVideoTags.Items.Cast<String>())) { if(!cbbVideoTags.Items.Contains(cbbVideoTags.Text)) { DaoVideo daoVideo = new DaoVideo(); daoVideo.openConnection(this.GetType(), "sqlErrorHandler"); daoVideo.insertTag(cbbVideoTags.Text, this.GetType(), "sqlErrorHandler"); daoVideo.closeConnection(); } lbVideoTags.Items.Add(cbbVideoTags.Text); cbbVideoTags.Text = ""; loadItemsIntoCbbVideoTags(); } cbbVideoTags.Focus(); }