Solved

how to make work a distinct in vb.net

Posted on 2014-04-23
4
365 Views
Last Modified: 2014-05-07
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
Comment
Question by:edo60
  • 2
4 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 40019042
I don't understand what you want.

Your query should return all distinct Nombre because the Where clause is not filtering anything out
0
 
LVL 11

Accepted Solution

by:
John_Vidmar earned 500 total points
ID: 40019064
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
 

Author Comment

by:edo60
ID: 40020861
oh man so confuse, how is to be?
tsm
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 40021448
So are we? Can you show us data for what you are trying to achieve?
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question