1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Imports System
Imports System.DateTime
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.VisualBasic
Public Class Form_pointage
Private Sub Tb_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tb.TextChanged
Dim con As SqlConnection = New SqlConnection("data source=localhost;Integrated Security=SSPI;Initial Catalog=C:\Users\Asma\Desktop\Sigma 3_210612\Mybasepointage.sdf")
Dim cmd As SqlCommand = con.CreateCommand()
cmd.CommandText = "SELECT Nom From Personne WHERE Personne.Code='" & Tb.Text & "'"
con.Open()
Dim myreader As SqlDataReader = cmd.ExecuteReader()
myreader.Read()
If myreader.HasRows Then
Lb2.Text = myreader(0)
End If
myreader.Close()
con.Close()
End Sub
end class |