For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Wednesday, September 03, 2014

Dictionary in C#

Dictionary in C#

Dictionary is faster that ArrayList and HashTable in C#, here is the example that how to use Dictionary in C#.



Dictionary<int, string> dict = new Dictionary<int, string>();
//You are free to use either :
//Dictionary<string,int> dict = new Dictionary<string,int>();
dict.Add(1, "AA");
dict.Add(2, "BB");
dict.Add(3, "CC");

foreach (var data in dict) {
      nmCode = data.Key.ToString();
      nm = data.Value.ToString();
}



Share:

0 comments:

Post a Comment

How to make center align child div

 How to make center align child div?   Suppose you have 2 Div tag. And want the make inner tag center <div id="d1">      ...

Ads Inside Post

Powered by Blogger.

Arsip

Blog Archive