Combo Box Problem.... i need a "light"....

I have 1 combo box whitch data source is a data base... but some item's of combo are duplicated... but i want only 1 item of eatch type like: (Monitor / Printer / Scanner / Printer), i would like remove second printer... i need do that on combo properties or on data base connection (combo <> DB)?

sorry my english...

[326 byte] By [Abobrix] at [2007-12-16]
# 1
The short answer is to use the DISTINCT keyword in the query which accesses your database table. For example...

SELECT DISTINCT PeripheralName FROM SystemTable

Here's the long answer. There should be a table that already has a distinct list of peripherals. (You should create one, if it doesn't already exist.) So, the real answer is to use this table as the source of your combo box. Using your example above, you'd have a Peripheral table with three records, one each for "Monitor", "Printer", and "Scanner". No need to do a DISTINCT and you have a better designed database.

Hope this helps.

- Mitchell S. Honnert

MitchellS.Honnert at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...