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 5961759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:00:39+00:00 2026-05-22T19:00:39+00:00

There are other questions such as KeyValuePair vs IDictionary, but I feel this one

  • 0

There are other questions such as KeyValuePair vs IDictionary, but I feel this one differs slightly.

NameValueCollection takes a string key and string value.

KeyValuePair is like a dictionary, you tell it what type the key and value is.

I don’t understand why NameValueCollection exists. Initializing a KeyValuePair with string types seems sufficient. I also noticed that NameValueCollection has some more methods available to it, but again why not merge both classes into one?

  • 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-05-22T19:00:39+00:00Added an answer on May 22, 2026 at 7:00 pm

    A KeyValuePair not like a dictionary. It is simply a Tuple containing the Key and the Value.

    NameValueCollection is wrapper over what amounts to a IList<KeyValuePair<string,IList<string>>> (note that NameValueCollection predates generics) – operations like Get(string) are O(n) and items can be fetched by index and each Key maps to one or more Values (this differs from a Dictionary<string,string>).

    A reason for this is explained in the NameValueCollection documentation:

    This class can be used for headers, query strings and form data.

    The newer “replacement” data-structure with some similar behavior for NameValueCollection is Lookup<string,string>. (However, it doesn’t directly support the same operations as is immutable as spender notes.)

    Happy coding.

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

Sidebar

Related Questions

There a bunch of other questions like this, but the only substantial answer I've
Disclaimer: I did check other questions that seemed related, but this one is much
There are other SO questions on speeding up jQuery Mobile for Android, but does
So there are other similar questions, but here's in particular what I want to
I know there are other questions similar such as: Ruby: how to check if
I've checked for other questions relevant to this, but the only answer is Use
There are other questions such as Scala: What is the difference between Traversable and
This is related to some other questions, such as: this , and some of
I realize there are a few other questions about why Cygwin is apparently slow,
Given my previous questions about the the usage of AMPL. Are there any other

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.