473,800 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Duplicate Items

In VWD I have an aspx page with a DropDownList control. The DropDownList
is populated from a column from a table in an Access database.
If there are duplicate values in the column they are added to the
DropDownList. Is there a way to eliminate duplicate items on the
DropDownList ?
Thanks,
Jim
Apr 25 '06 #1
3 1866
Use the DISTINCT keyword in the SQL that generates the drop down list, e.g.

SELECT DISTINCT ValueField, TextField FROM Table

This will return only unique rows.

"Jim McGivney" wrote:
In VWD I have an aspx page with a DropDownList control. The DropDownList
is populated from a column from a table in an Access database.
If there are duplicate values in the column they are added to the
DropDownList. Is there a way to eliminate duplicate items on the
DropDownList ?
Thanks,
Jim

Apr 25 '06 #2
use the distinct keyword in your query:

SELECT DISTINCT BLAH FROM Table

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Jim McGivney" <jm*******@nosp am.sbcglobal.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
In VWD I have an aspx page with a DropDownList control. The DropDownList
is populated from a column from a table in an Access database.
If there are duplicate values in the column they are added to the
DropDownList. Is there a way to eliminate duplicate items on the
DropDownList ?
Thanks,
Jim

Apr 25 '06 #3
One option is to change the SQL query used to populate the dropdownlist to
use DISTINCT
--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics. com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services


"Jim McGivney" <jm*******@nosp am.sbcglobal.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
In VWD I have an aspx page with a DropDownList control. The DropDownList
is populated from a column from a table in an Access database.
If there are duplicate values in the column they are added to the
DropDownList. Is there a way to eliminate duplicate items on the
DropDownList ?
Thanks,
Jim

Apr 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

44
4074
by: Xah Lee | last post by:
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are identical with which. Write a program that prints out which file are redundant copies. Here's the spec. -------------------------- The program is to be used on the command line. Its arguments are one or
1
4240
by: pcb | last post by:
Hi All, I have a multi-select listbox, that can have duplicate items (i.e samples numbers that are analyzed in duplicate - the sample IDs are not the same, but these IDs are hidden from the user). I want to loop through the items on the listbox, but only use unique sample numbers. Here is what I have:
10
3305
by: Adam Clauss | last post by:
I have a page containing a list box. This list may contain duplicate items - in which the ORDER is important. ex: a b b a is significant as compared to: b
5
8932
by: mamatha | last post by:
Hi I am developing a VB.NET application,in that application i have a listbox.When adding items to the listbox some duplicate items are added,how can i prevent listbox items from duplication.If any one knows please suggest me. Mamatha
4
2838
by: gurvar | last post by:
Hi I'm trying to remove duplicate elements from a Drop Down List Fill in VB.net. Following code worked well with vb6. But I'm getting index out of range if I try to translate it to vb.net code at line#4. Any possible clues will be appreciated. Thanks. 'To distill the Combo Element NumY = Combo5.ListCount + 1 '''''''''''''''Line1 For NumX = 1 To Combo5.ListCount '''''''line2
4
3634
by: Shi Mu | last post by:
I used the following method to remove duplicate items in a list and got confused by the error. >>> a , , ] >>> noDups='] ] Traceback (most recent call last): File "<interactive input>", line 1, in ? TypeError: iterable argument required
2
7704
by: news | last post by:
I just upgraded to PHP 4.4.2 on my Slackware 10.2 system. And Apache/mySQL/PHP all work great through a browser. No errors. But when I try to run a PHP script through the command line, which I need to do, I get blocks of errors like: root@slackserve:/var/www/htdocs# php ./phptest.php PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php/extensions/mysql.so' - libmysqlclient.so.14: cannot open shared object file: No such...
0
960
by: ronchese | last post by:
Hello All. I have been working fine with the IDE for months (Visual Studio Standard Edition), and when I close a project to open another, I got double, triple and n repeated items in menu items and some toolbars. I tried: 1) Reset the command bars: No success - no changes come 2) Remove the items manually: No success - after reopen IDE the duplicate
1
3486
by: gaikokujinkyofusho | last post by:
Hi, I have been enjoying being able to subscribe to RSS (http://kinja.com/user/thedigestibleaggie) for awhile and have come up with a fairly nice list of feeds but I have run into an annoying (though not critical) problem, duplicate stories. Apparently there is overlap with some of the sites I subscribe to so I get duplicate stories. Does anyone know of some sort of filter (software or online service) that can remove duplicate stories? Any...
4
2446
by: ejack | last post by:
int total = static_cast<int>(vComp.size()) - 1; int tTotalUnits = 0; float tTotalCostJob = 0; int i = 0; int j = 0; int counter = 0; bool foundFlag; vector<string> vItems; vector<string> vHolding;
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10274
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.