how to make work a distinct in vb.net

hi all
how can i make work this


       Visitante.Text = ""
        Dim sqlmatriz2 As String = "select distinct nombre from contactos where nombre like '%" & Visitante.Text & "%' order by nombre  "
        Dim trasn2 As New SqlDataAdapter(sqlmatriz2, conn)
        Dim dtrans2 As New DataSet
        trasn2.Fill(dtrans2, "contactos")

is not doing the like is in a combobox sugest append configured
tsm
ErnestoAsked:
Who is Participating?
 
John_VidmarConnect With a Mentor Commented:
Your first line clears the value contained in Visitante.Text, so your final query is as follows (which returns all data from contactos):
select distinct nombre from contactos where nombre like '%%' order by nombre

Open in new window

0
 
Éric MoreauSenior .Net ConsultantCommented:
I don't understand what you want.

Your query should return all distinct Nombre because the Where clause is not filtering anything out
0
 
ErnestoAuthor Commented:
oh man so confuse, how is to be?
tsm
0
 
Éric MoreauSenior .Net ConsultantCommented:
So are we? Can you show us data for what you are trying to achieve?
0
All Courses

From novice to tech pro — start learning today.