combobox - C# Compare two comboxBox values and remove duplicate values -
i have 2 comboboxes have duplicate values, problem need compare tow comboboxes , need remove duplicate values in combobox 1 only, here code express how remove duplicates in comparing 1 combobox value. please support me.
combobox1.items.addrange(dt.asenumerable().select(i => i.itemarray[0]).distinct().toarray()); datatable table = new datatable(); { using (sqldataadapter da = new sqldataadapter(@"select lorryno table1", cs)) da.fill(table); } cs.open(); combobox1.datasource = new bindingsource(table, null); combobox1.displaymember = "lorryno"; cs.close(); datatable table2 = new datatable(); { using (sqldataadapter da2 = new sqldataadapter(@"select lorryno table2", cs)) da2.fill(table2); } cs.open(); combobox2.datasource = new bindingsource(table, null); combobox2.displaymember = "lorryno"; cs.close();
Comments
Post a Comment