Solved

hashtable mutliple parameters to one key

Posted on 2006-06-13
3
200 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

777 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