Hello,
I have a problem I need to show datas from an access data base to labels, which it works.
The problem is that if I choose one register it will appear but the next it does not appear, it seems to be stick into the first query.
This is my code. What I need is to make appear show the next datas.
Thank you,
I have a problem I need to show datas from an access data base to labels, which it works.
The problem is that if I choose one register it will appear but the next it does not appear, it seems to be stick into the first query.
This is my code. What I need is to make appear show the next datas.
Code:
Private Sub BTBuscar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTBuscar.Click
If Not Conex.State = ConnectionState.Open Then
Conex.Open()
End If
If Not TXTBusquedaDB.Text = "" Then
Try
Dim query As String = ("SELECT nombre,apellido,direccion,telefono,email from CLIENTE where Cod_cliente=" & TXTBusquedaDB.Text & "")
adap = New OleDbDataAdapter(query, Conex)
adap.Fill(dt)
TXTNombre.Text = dt.Rows(0)(0).ToString()
TXTApellidos.Text = dt.Rows(0)(1).ToString()
TXTDireccion.Text = dt.Rows(0)(2).ToString()
TXTTelefono.Text = dt.Rows(0)(3).ToString()
TXTemail.Text = dt.Rows(0)(4).ToString()
Conex.Close()
Catch ex As Exception
MsgBox("Registro no existe" & Chr(13) & "Puede comprobar los registros a traves de la lista", MsgBoxStyle.Information, vbOK)
End Try
ElseIf TXTBusquedaDB.Text = "" Then
TXTBusquedaDB.Text = ""
End If
Conex.Close()
End Sub