• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 376
  • Last Modified:

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
0
Ernesto
Asked:
Ernesto
  • 2
1 Solution
 
É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
 
John_VidmarCommented:
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now