Manipulating HashTables

Discussion in 'ASP .Net' started by Andrew Sweetman, Aug 22, 2003.

  1. Hi everybody,

    Does anyone know how to get the key of the last item added to a hashtable?

    Many thanks,

    Andy. (ASP.NET virgin, ready for sacrifice)
     
    Andrew Sweetman, Aug 22, 2003
    #1
    1. Advertising

  2. I don't believe the hashtable stores that information (the order in which
    items were inserted.)
    If you're using VB.NET the built in collection class should give you the
    functionality you desire:
    http://msdn.microsoft.com/library/d.../html/vbconthevisualbasiccollectionobject.asp

    If you're using C# you'll probably have to do things the hard way (as
    usual.) You might consider inheriting from the hashtable to add this
    functionality.
    Here's more info:
    http://msdn.microsoft.com/library/d...frlrfsystemcollectionshashtableclasstopic.asp

    Or maybe another kind of collection class might work out better for you.
    Perhaps a Queue?
    Here's more info:
    http://msdn.microsoft.com/library/d...y/en-us/cpref/html/frlrfsystemcollections.asp

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net
    Hire top-notch developers at http://www.able-consulting.com



    "Andrew Sweetman" <> wrote in message
    news:7kv1b.1142$...
    > Hi everybody,
    >
    > Does anyone know how to get the key of the last item added to a hashtable?
    >
    > Many thanks,
    >
    > Andy. (ASP.NET virgin, ready for sacrifice)
    >
    >
     
    Steve C. Orr, MCSD, Aug 22, 2003
    #2
    1. Advertising

  3. I meant a Stack, not a Queue.

    Also, even if you're using C# you could "cheat" and import the VB.NET
    namespace and use the collection object anyway.
    http://msdn.microsoft.com/library/d.../html/vbconthevisualbasiccollectionobject.asp

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net
    Hire top-notch developers at http://www.able-consulting.com



    "Steve C. Orr, MCSD" <> wrote in message
    news:ue$...
    > I don't believe the hashtable stores that information (the order in which
    > items were inserted.)
    > If you're using VB.NET the built in collection class should give you the
    > functionality you desire:
    >

    http://msdn.microsoft.com/library/d.../html/vbconthevisualbasiccollectionobject.asp
    >
    > If you're using C# you'll probably have to do things the hard way (as
    > usual.) You might consider inheriting from the hashtable to add this
    > functionality.
    > Here's more info:
    >

    http://msdn.microsoft.com/library/d...frlrfsystemcollectionshashtableclasstopic.asp
    >
    > Or maybe another kind of collection class might work out better for you.
    > Perhaps a Queue?
    > Here's more info:
    >

    http://msdn.microsoft.com/library/d...y/en-us/cpref/html/frlrfsystemcollections.asp
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD
    > http://Steve.Orr.net
    > Hire top-notch developers at http://www.able-consulting.com
    >
    >
    >
    > "Andrew Sweetman" <> wrote in message
    > news:7kv1b.1142$...
    > > Hi everybody,
    > >
    > > Does anyone know how to get the key of the last item added to a

    hashtable?
    > >
    > > Many thanks,
    > >
    > > Andy. (ASP.NET virgin, ready for sacrifice)
    > >
    > >

    >
    >
     
    Steve C. Orr, MCSD, Aug 22, 2003
    #3
    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. =?Utf-8?B?U3VuZGFyYXJhamFu?=

    Caching Hashtables

    =?Utf-8?B?U3VuZGFyYXJhamFu?=, Jul 24, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    699
    Yunus Emre ALPĂ–ZEN [MCSD.NET]
    Jul 30, 2005
  2. Replies:
    1
    Views:
    535
    Karl Seguin
    Oct 17, 2005
  3. J.Eddy

    Java Hashtables

    J.Eddy, Jul 16, 2003, in forum: Java
    Replies:
    3
    Views:
    508
    Roedy Green
    Jul 17, 2003
  4. Replies:
    2
    Views:
    361
  5. Replies:
    3
    Views:
    376
    Roedy Green
    Sep 29, 2005
Loading...

Share This Page