DayWalker Posted August 4, 2003 Posted August 4, 2003 I am filling a combobox from a sql table. ie: Dim dataAdapter as new SqlDataAdapter("SELECT ID, Barcode FROM Table WHERE Barcode = ' " & txtBarcode.text & " '", Connection) Dim DataSet as new DataSet dataAdapter.Fill(DataSet, "Table") With combobox .datasource = DataSet.Tables("Table") .DisplayMember = "ID" End With It works fine the problem is there are about 12 ID's with the value of 1; 2 ect. All with the same barcodes. Is there a way to only display 1 instance of 1 and 1 instance of 2..ect in the combobox?? Quote
DayWalker Posted August 4, 2003 Author Posted August 4, 2003 I tired using "Select Distinct ........" but it throws a error?? Quote
Administrators PlausiblyDamp Posted August 4, 2003 Administrators Posted August 4, 2003 What error did it give? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
DayWalker Posted August 5, 2003 Author Posted August 5, 2003 Its fine i sorted it out. I had put brackets in the statement once i took them out it was fine : SELECT Distinct ID, Barcode FROM.... This works 100% Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.