I have the following code :
List<Dictionary<string, string>> allMonthsList = new List<Dictionary<string, string>>(); while (getAllMonthsReader.Read()) { Dictionary<string, string> month = new Dictionary<string, string>(); month.Add(getAllMonthsReader["year"].ToString(), getAllMonthsReader["month"].ToString()); allMonthsList.Add(month); } getAllMonthsReader.Close(); Now I'm trying to loop through all of the months, like this :
foreach (Dictionary<string, string> allMonths in allMonthsList) How do I access the key values? Am I doing something wrong?