private void CheckListBox_SelectedIndexChanged(object sender, EventArgs e) { string myString = ""; MyListBox = (CheckedListBox)sender; MyList = MyListBox.CheckedItems; for (int i = 0; i < MyList.Count; i++) { myString += MyList[i].ToString(); if ((i+1) < MyList.Count) { myString += ", "; } } MySqlStatement = "SELECT "+ myString + " FROM Activity"; }
private void InicializarValores() { tipoPublicacion = (TipoPublicacion)this.comboTipoPubli.SelectedValue; this.visibilidades.SelectedItem = this.ObtenerVisibilidad(publicacion.visibilidad_codigo); this.descripcionTextBox.Text = publicacion.descripcion; this.txtBoxPrecio.Text = publicacion.precio.ToString(); this.txtBoxStock.Text = publicacion.stock.ToString(); this.preguntas.Checked = publicacion.permitePregunta; this.fechaPicker.Value = publicacion.fecha_inicio; foreach (Visibilidad visibilidad in this.visibilidades.Items) { this.SeEncontroElValorAInicializar(visibilidad.visibilidadCodigo, this.publicacion.visibilidad_codigo, visibilidad, this.visibilidades); } foreach (Estado state in this.estado.Items) { this.SeEncontroElValorAInicializar(state.id, this.publicacion.estado.id, state, this.estado); } foreach (TipoPublicacion tipoPubli in this.comboTipoPubli.Items) { this.SeEncontroElValorAInicializar(tipoPubli.id, this.publicacion.tipo.id, tipoPubli, this.comboTipoPubli); } this.CheckearRubros(); this.rub = this.RubrosCheckList.CheckedItems; }