Dim sqlConString As String = "Server=localhost\TESTE;Database=tempTest;User Id=sa;Password=123"
Try
Using con = New SqlConnection(sqlConString)
con.Open()
Using cmd = con.CreateCommand
'' Para filtrar
cmd.CommandText = "SELECT * FROM Clientes where NIF LIKE '" + TextBox1.Text + "%'"
cmd.CommandText = "select * from Clientes"
Using reader = cmd.ExecuteReader
Dim counter As Int32 = 0
While reader.Read
ListView1.Items.Add(reader.GetString(reader.GetOrdinal("NIF")), counter)
counter = counter + 1
ListView1.Items.Add(reader.GetString(reader.GetOrdinal("Nome")), counter)
counter = counter + 1
ListView1.Items.Add(reader.GetString(reader.GetOrdinal("Telefone")), counter)
counter = counter + 1
''MsgBox(reader.GetString(reader.GetOrdinal("NIF")))
End While
End Using
End Using
End Using
Catch ex As Exception
MsgBox(ex.ToString())
End Try
I want you to be on each table of these link