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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:39:53+00:00 2026-05-15T07:39:53+00:00

Is there an collection in .net that allows the storing KeyValuePair<string, string> that keeps

  • 0

Is there an collection in .net that allows the storing KeyValuePair<string, string> that keeps the order of inserting?
OrderedDictionary looked promising, but seems to be rather lacking.
Now I’m looking into IOrderedEnumerable>, but I can’t seem to find any implementation except for ISortedDictionary, but that’s not what I want. No sorting needs to be done, just the order of inserting is important.

Update
The reason I don’t like OrderedDictionary is that it’s not generic.

  • 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-15T07:39:54+00:00Added an answer on May 15, 2026 at 7:39 am

    OrderedDictionary is what you want if you need both keyed and insertion-sequenced access to items … it’s really just a combination of a hash table and a list. It provides a means to access items in it either by insertion index or by key. It’s the only collection in .NET that does this. Sadly, it is not generic.

    If OrderedDictionary doesn’t meet your needs solely because it is not generic – then you can use the version here that provides a generic equivalent. If there are other reasons why it doesn’t work for you, update your post and we can look for a better option.

    While you can certainly create your own List<KeyValuePair<string,string>> you will lose the option of searching by key efficiently. Now, you can certainly roll your own implementation of an ordered doctionary that combined list/dict together … but the post I’ve linked to already does this.

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

Sidebar

Related Questions

Is there a specific collection type in .NET that allows storing a limited number
Is there a collection (BCL or other) that has the following characteristics: Sends event
In the vein of programming questions : suppose there's a collection of objects that
Is there a way that you can get a collection of all of the
Is there a built in node-like collection that will allow me to store information
In VB6, there used to be a Collection data type that would allow retrieval
I am working on an ASP.net Forms Application that keeps track of information about
Is there a Generics Friendly way of using Collection.EMPTY_LIST in my Java Program. I
Is there any way to read a collection of extension elements with Universal Feed
Is there any way to print in memory collection or variable size in WPF?

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.