Best collection for data in C# .NET -


i have store data:

 "al" => 1997  "ak" => 1977  ...  "wy" => 1997 

what's best way store in .net? shall use arrays, or arraylist, or collection?

try system.collections.generic.dictionary<tkey, tvalue>.

you use this:

var values = new dictionary<string, int> {     { "al", 1997 },     { "ak", 1977 },     ...     { "wy", 1997 }, };  console.writeline(values["ak"]);  // writes 1977 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -