protected void CargarSectorEconomico() { try { CatSectoresEconomicosBehaivor sectorItem = new CatSectoresEconomicosBehaivor(); sectorItem.Connection = ConectionBD; List <CatSectoresEconomicosDatos> sectorLst = sectorItem.CN_fn_SectoresEconomicosSel(1); cmbSector.DataTextField = "sectorEconomico"; cmbSector.DataValueField = "IdSectorEconomico"; cmbSector.DataSource = sectorLst; cmbSector.DataBind(); cmbSector.Items.Insert(0, "Seleccione un sector económico"); } catch (Exception ex) { throw ex; } }
protected void CargarSectorEconomico() { try { CatSectoresEconomicosBehaivor sectorItem = new CatSectoresEconomicosBehaivor(); sectorItem.Connection = ConectionBD; List <CatSectoresEconomicosDatos> sectorLst = sectorItem.CN_fn_SectoresEconomicosSel(1); cmbSector.DataTextField = "sectorEconomico"; cmbSector.DataValueField = "IdSectorEconomico"; cmbSector.DataSource = sectorLst; cmbSector.DataBind(); cmbSector.Items.Insert(0, new ListItem("Seleccione un Sector económico", "0")); } catch (Exception ex) { mensajeErrorlbl.Visible = true; mensajeErrorlbl.ForeColor = System.Drawing.Color.Red; mensajeErrorlbl.Text = "!Error / Cargar Sector: " + ex.Message + "!"; } }