Solved

how to make work a distinct in vb.net

Posted on 2014-04-23
4
362 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
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.​
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

790 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