Windows Forms Topics include: windows forms, controls, components and designers

Go Back  Xtreme .NET Talk > .NET > Windows Forms > Re: Remove Duplicate items from a ComboBox How?


Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2012, 12:43 AM
ashwinims ashwinims is offline
Newcomer
 
Join Date: Mar 2012
Posts: 1
ashwinims is on a distinguished road
Default Re: Remove Duplicate items from a ComboBox How?



hi,
am using .net framework 3.5. in load,am taking values from 2 tables to one combobox. and i call values from combobox same values are repeated i think its bcz of calling from 2 tables. plz tell how to remove duplicate values in it..
Thank u

Note from moderator: Please place new questions in their own topics. If there is another relevant topic you would like to reference, include a link to it. Thanks!

Last edited by snarfblam; 03-13-2012 at 12:14 PM.
Reply With Quote
  #2  
Old 03-13-2012, 02:12 PM
dotnetguy37 dotnetguy37 is offline
Freshman
 
Join Date: Nov 2009
Posts: 29
dotnetguy37 is on a distinguished road
Default Re: Remove Duplicate items from a ComboBox How?

Did you do a search of the forum?

I did and found some code in this post (don't know what ..Net framework it goes with).

Make sure the DataSource property is not set though, or else.

If that code doesn't work for you try the code on this page.
Reply With Quote
  #3  
Old 03-26-2012, 11:41 PM
korachetan korachetan is offline
Newcomer
 
Join Date: Nov 2011
Posts: 1
korachetan is on a distinguished road
Default Re: Remove Duplicate items from a ComboBox How?

write a sql query which you want to use to fill combo in that use UNION and then bind it to the combo

for example: (select empname from employeemaster) union (select empname from empdetails)

then using datareader or dataset bind the values.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Remove Duplicate items from a ComboBox How? jisty_guy Windows Forms 1 09-24-2010 04:10 PM
Remove Duplicate items from a ComboBox How? vbMarkO Windows Forms 14 10-13-2008 09:14 PM
Removing duplicate items in a ComboBox bjwade62 Windows Forms 2 02-17-2006 01:20 PM
Remove all currently selected listbox items micropathic Windows Forms 3 06-06-2004 10:17 PM
form2.listbox.Items = form1.Combobox.Items torg Windows Forms 3 04-19-2003 07:06 AM

Advertisement:







Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe