How can I remove duplicates from an ArrayList?

Discussion in 'ASP .Net Web Controls' started by Chuck Insight, Mar 6, 2005.

  1. Chuck Insight, Mar 6, 2005
    #1
    1. Advertising

  2. Chuck Insight

    MasterGaurav Guest

    MasterGaurav, Mar 6, 2005
    #2
    1. Advertising

  3. 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:%...
    > 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
    Chuck Insight, Mar 8, 2005
    #3
  4. Thanks Alvin, I'll work at this for a while.

    "Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> wrote in message
    news:eh3BUo$...
    > 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" <> 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:%...
    > >> 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

    > >
    > >

    >
    >
    Chuck Insight, Mar 10, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven Bethard
    Replies:
    11
    Views:
    1,011
    Alex Martelli
    Feb 7, 2005
  2. Jesper Mortensen
    Replies:
    1
    Views:
    480
  3. bob

    remove duplicates?

    bob, Sep 5, 2011, in forum: Java
    Replies:
    4
    Views:
    405
    Roedy Green
    Sep 5, 2011
  4. senthil
    Replies:
    10
    Views:
    393
  5. andrea
    Replies:
    2
    Views:
    125
    andrea
    May 12, 2008
Loading...

Share This Page