Showing posts with label Dictionary. Show all posts
Showing posts with label Dictionary. Show all posts

Monday, December 17, 2012

NameValueCollection In C#.NET

Introduction: In this article we will see what is NameValueCollection  class provided by .NET and when to use this class.

Description:

1.       It’s a data structure that store data in Key(String) and Value(string) format.
2.       It allows user to store multiple(duplicate) values for the same Key.
3.       You can access data either via Key or via index.
4.       It’s very similar to HashTable that also allow you to store data in Key and Value format.
5.       When you add a value in the NameValueCollection , Its size grows automatically by relocation.
6.       This class is situated in System.Collections.Specialized namespace.
7.       Its performance is very poor than any other data structure like List, Dictionary or Hash Table so you must be very careful while choosing this data structure unless you tested it for performance.