Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > How can I remove duplicates from an ArrayList?

Reply
Thread Tools

How can I remove duplicates from an ArrayList?

 
 
Chuck Insight
Guest
Posts: n/a
 
      03-06-2005


 
Reply With Quote
 
 
 
 
MasterGaurav
Guest
Posts: n/a
 
      03-06-2005
You need to do it manually.


--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
----------------------

 
Reply With Quote
 
 
 
 
Chuck Insight
Guest
Posts: n/a
 
      03-08-2005
Hi Alvin,
I am unfamiliar with what a hash table is let alone how to populate it.
I use the .ADD("") method populate an ArrayList, how do I populate these
tables?
Please name a few WEB Controls that can display the contents of the table.
And finally, what should I do when this kind of error occurs?
Thanks for helping a rank beginner become better.
Chuck

"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
news:%(E-Mail Removed)...
> one approach is to use a hash table instead of an arraylist since a hash
> table enforces unique constraints. You wouldn't need to worry about
> duplicates since an exception is thrown.
>
> --
> Regards,
> Alvin Bruney



 
Reply With Quote
 
Chuck Insight
Guest
Posts: n/a
 
      03-10-2005
Thanks Alvin, I'll work at this for a while.

"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
news:eh3BUo$(E-Mail Removed)...
> roughly
> Hashtable table = new Hashtable();
> table["Key"] = str;
>
> //exception here duplicate
> table["Key"] = str;
>
> string str = (string)table["Key"];
>
> //load data
> foreach(string str in Hashtable)
> DropDownList1.Add(str);
>
> Consult your help system for more details.
>
> --
> Regards,
> Alvin Bruney
>
> [Shameless Author Plug]
> The Microsoft Office Web Components Black Book with .NET
> available at www.lulu.com/owc
> ------------------------------------------------------------
>
> "Chuck Insight" <(E-Mail Removed)> wrote in message
> news:AGgXd.105607$tl3.17207@attbi_s02...
> > Hi Alvin,
> > I am unfamiliar with what a hash table is let alone how to populate it.
> > I use the .ADD("") method populate an ArrayList, how do I populate these
> > tables?
> > Please name a few WEB Controls that can display the contents of the

table.
> > And finally, what should I do when this kind of error occurs?
> > Thanks for helping a rank beginner become better.
> > Chuck
> >
> > "Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
> > news:%(E-Mail Removed)...
> >> one approach is to use a hash table instead of an arraylist since a

hash
> >> table enforces unique constraints. You wouldn't need to worry about
> >> duplicates since an exception is thrown.
> >>
> >> --
> >> Regards,
> >> Alvin Bruney

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
remove duplicates? bob Java 4 09-05-2011 06:07 PM
Remove inherited web.config values that are duplicates Jesper Mortensen ASP .Net 1 07-06-2009 10:38 PM
Array#uniq with Hash elements... can't remove duplicates andrea Ruby 2 05-12-2008 08:30 AM
remove duplicates from list *preserving order* Steven Bethard Python 11 02-07-2005 09:34 AM



Advertisments