Dictionary<string, int> data = new Dictionary<string, int>(); data.Add("abc", 123); data.Add("def", 456); foreach (string key in data.Keys) // look carefully Keys is used with "s" in it { Console.WriteLine(key); }