protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { try { ListBox_Colaboradores.Items.Clear(); ServicioRef_WebService_BD.WS_Base_DatosSoapClient WS = new ServicioRef_WebService_BD.WS_Base_DatosSoapClient(); DataSet ds = WS.BuscarColaboradores(); DataTable tablaColaboradores = ds.Tables[0]; foreach (DataRow row in tablaColaboradores.Rows) { ListBox_Colaboradores.Items.Add(row["Nombre"].ToString()); } } catch { MessageBox("Hubo un error cargando los colaboradores!."); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { try { DropDownList_Actividades.Items.Clear(); DropDownList_Colaboradores.Items.Clear(); //Colaboradores ServicioRef_WebService_BD.WS_Base_DatosSoapClient WS = new ServicioRef_WebService_BD.WS_Base_DatosSoapClient(); DataSet ds_1 = WS.BuscarColaboradores(); DataTable tablaColaboradores = ds_1.Tables[0]; foreach (DataRow row in tablaColaboradores.Rows) { DropDownList_Colaboradores.Items.Add(row["Nombre"].ToString()); } //Actividades DataSet ds_2 = WS.ObtenerActividades(); DataTable tablaActividades = ds_2.Tables[0]; foreach (DataRow row in tablaActividades.Rows) { DropDownList_Actividades.Items.Add(row["Nombre"].ToString()); } } catch { MessageBox("Hubo un error cargando la información, reintente nuevamente!."); } } }