Solved

hashtable mutliple parameters to one key

Posted on 2006-06-13
3
193 Views
Last Modified: 2010-04-23
how do i have mutilpe paratemer accosicated to one key

ie

employee 1 key

firstname = somevalue
lastname = some value

employee 2 key

firstname = somevalue
lastname = some value
0
Comment
Question by:tpiazza55
3 Comments
 
LVL 18

Accepted Solution

by:
Ravi Singh earned 50 total points
ID: 16895538
Encapsulate the value part in a class... e.g

        Public Class Name
                Public FirstName As String
                Public SecondName As String
        End Class

Then you can create instances of it and store the instance in the hashtables value part:

        Dim HT As New Hashtable

        'Create a name object
        Dim Name1 As New Name
        Name1.FirstName = "John"
        Name1.SecondName = "Doe"

        'Store in hashtable
        HT.Add("key", Name1)

        'Retrieve the name object
        Dim Name2 As Name = HT("key")
        Dim FirstName As String = Name2.FirstName
        Dim SecondName As String = Name2.SecondName

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now