I need to use a dictionary inside this list
List<Dictionary<string, string>> People= new List<Dictionary<string, string>>();
So far I have tried to populate it with this
People[0] = new Dictionary<string, string>();
People[0].Add("ID number", "1");
People[0].Add("Name", "John");
and display it to the console
for (int i = 0; i < People.Count; i++)
{
Console.WriteLine(People[i]["ID number"]);
Console.WriteLine(People[i]["Name"]);
}
I got
System.ArgumentOutOfRangeException
error on run, any fixes?