This question already has an answer here:

I am trying to add values to dictionary. Here is my code :-

public class EmpModel
    public Dictionary<String, String> EmpColumns { get; set; }


EmpModel model = new EmpModel();
model.EmpColumns.Add("one", "1"); // It gives error here

An exception of type


Why i am getting this error? How to solve this?

Related posts

Recent Viewed