can someone tell me how to do this???
i have a product category in a combobox and the associated product codes in a list box.
i'm using oracle for backend.

the combobox on form loading shows the product categories from oracle database.
but the product category is not a primary key in the db . hence the combobox shows all the duplicate categories as well, which i dont want.
the list box shows the product codes associated with each item in the combobox wen a particular product category is selected in the combobox. the product code is a primary key.
i need the listbox to show all product codes associated with one particular selected category in the combobox.
since code and category are in the same table (product) , i cant make the category as a primary key too.
how do i go about with it???

Sounds like you need to take code out of the same table as category, might help make the system more usable.

i transferred the product category to another table.

*use distinct to get single item entered into combobox.

well I dont exacly understand why ur trying to do. I presume you're listing items from textfile. So to delete "duplicated items" simply use this code :

'there is the code to add item from richtextbox 1by1 , in case of.

dim infoD As New IO.DirectoryInfo(RichTextBox1.Text)
Dim infoF As IO.FileInfo() = di.GetFiles()
Dim di As IO.FileInfo

For Each di In infoF
Dim lol As String = di.ToString
lol = System.IO.Path.GetFileNameWithoutExtension(lol)
'here is the code to prevent duplicated items .
If ComboBox1.Items.Contains(lol) Then

Else
ComboBox1.Items.Add(lol)
End If
Next


Hope that helped you !! ~Ben

This question has already been answered. Start a new discussion instead.