Ver Mensaje Individual
  #6 (permalink)  
Antiguo 11/04/2007, 11:59
miguelillo2
 
Fecha de Ingreso: octubre-2005
Mensajes: 180
Antigüedad: 19 años, 4 meses
Puntos: 0
Re: Cargar combobox

Dices que ya tienes tu SP en tu bd.---

ahora lo que debes hacer primeramente es abrir la conexion a tu bd.--

Cargas tus datos a un dataset, o aun datatable... etc..

Suponiendo que lo cargaste en un dataset... y que vas a cargar el combo al cargar la page... then...

Haremos lo siguiente:

Código:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Mi conexion.......

Mi adapter......

Mi dataset.....

     Response.Write("<select size='1' name='micombo' tabindex='1' >" & vbCrLf)
            Response.Write("<option value='0'>( todos )</option>" & vbCrLf)
            dim dr as datarow
                
                For Each dr In my_dataset.Tables("mitabla").Rows
                  Response.Write("<option value='" & dr("mi_campo_valor") & "'")
                  Response.Write(">" & dr("mi_campo_nombre") & "</option>" & vbCrLf)
               Next
            
            Response.Write("</select>" & vbCrLf)

End sub
Espero y te sirva.---suerte

Bitss---Miguel---in----