Solved

hashtable mutliple parameters to one key

Posted on 2006-06-13
3
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …

763 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