Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/07/2013, 12:17
lordbeliar2010
 
Fecha de Ingreso: junio-2013
Mensajes: 18
Antigüedad: 10 años, 10 meses
Puntos: 0
como refrescar listbox al momento de acer click en guardar EN VBNET2005

SALUDOS COLEGAS

TENGO UN LISTBOX Y MUESTRO EL NOMBRE DEL PRODUCTO Q VIENE DE UNA TABLA EN MI BASE DE DATOS.

AL MOMENTO DE HACER CLICK EN EL BOTON GUARDAR , COMO MUESTRO O REFRESCO O ACTULIZO MI LISTBOX CON EL NUEVO CODIGO Q ACABO DE GUARDAR.

TODO ESTO LO QIERO ACER EN TIEMPO DE EJECUCION.
SIN TENER Q CERRAR MI VENTANA Y VOLVER ABRILA PARA Q ME MUESTRE EN EL LISTBOX EL NUEVO CAMPO AGREGADO



LES DEJO EL CODIGO DE LISTBOX

Código PHP:
Public Sub Cargar_Cod_Producto()
        
Dim query As String
        query 
"Select cod_producto from producto"
        
Dim sqdataadapter As New SqlDataAdapter(querycnx)
        
Dim datase As New DataSet("ferr2013")
        
Dim datavi As DataView
        Dim databla 
As DataTable
        Dim vdato 
As String
         Dim a 
As String
        Dim x 
As Integer

        
Try
            
cnx.Open()
            If 
cnx.State ConnectionState.Open Then

                sqdataadapter
.Fill(datase"producto")
                
databla datase.Tables("producto")
                
datavi databla.DefaultView
                
For 0 To datase.Tables("producto").Rows.Count 1
                    vdato 
datase.Tables("producto").Rows(x).Item(0).ToString
                    ListBox1
.Items.Add(vdato)
                
Next

            End 
If
        Catch 
ex As Exception
            MsgBox
(ex.Message)
        
End Try
        
cnx.Close()
    
End Sub