Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8293541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:51:47+00:00 2026-06-08T13:51:47+00:00

Straight from the w3schools web site, why would I want to put these items

  • 0

Straight from the w3schools web site,
why would I want to put these items into a hashtable?

Is this more for large amounts of data and this is just a simple demo?
Otherwise why would I spend the time to put it into a hashtable why not just put it in an array?

dim mycountries=New Hashtable
  mycountries.Add("N","Norway")
  mycountries.Add("S","Sweden")
  mycountries.Add("F","France")
  mycountries.Add("I","Italy")
  rb.DataSource=mycountries
  rb.DataValueField="Key"
  rb.DataTextField="Value"
  rb.DataBind()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:51:49+00:00Added an answer on June 8, 2026 at 1:51 pm

    An array holds a bunch of single-valued things.

    dim mycountries = new Collection ' My VB.Net is very rusty... hope this is right
    mycountries.Add("Norway")
    mycountries.Add("Sweden")
    mycountries.Add("France")
    mycountries.Add("Italy")
    

    A Hashtable (or indeed also a Dictionary) holds a bunch of key-value pairs.

    mycountries.Add("N","Norway")
    ' etc.
    

    When one later enumerates a Hashtable, one gets back a KeyValuePair<string,string> rather than just a string one would get from the Collection.

    This example sets the key to a short version of the value, so an array would not work (it can only hold a value).

    Certainly you could use an array that holds a type that in turn has a key and a value, but using a Hashtable is more straightforward.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code is straight from the original page of the jQuery.Path plugin, only I
The following code is straight from the docs and should insert a row into
I got this code straight from How to: Copy, Delete, and Move Files and
Most of this is straight from the hint example. What I'd like to do
I have a page that is straight from the jQueryMobile site. I'm including a
I am looking at this code lifted straight from the MapViewController.m file in the
I am getting an Indention Error. This code is straight from the django first
This is straight from the Java Docs : This class and its iterator implement
Can someone explain this (straight from the docs - emphasis mine): math.ceil(x) Return the
I'm learning C right now, and I copied this little snippet straight from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.