Unable to add to a csharp dictionary definition, recieveing "Object Reference Not Set to an instance..."
<p>Hey Guys, I'm trying to add to a dictionary, and recieveing the "Object reference not set to an instance of an object." error. Which I think means that what I'm trying to set it to doesn't exist?</p>

<p>This is the relevant code:</p>

<pre><code>                Dictionary&lt;string, Dictionary&lt;int, Dictionary&lt;string, string&gt;&gt;&gt; user = new Dictionary&lt;string, Dictionary&lt;int, Dictionary&lt;string, string&gt;&gt;&gt;();
            user.Add("approved", null);
            user.Add("pending", null);
            user.Add("declined", null);
            int zz = 0;

            while (results.Read())
            {
                Dictionary&lt;string, string&gt; field = new Dictionary&lt;string, string&gt;();
                for (int i = 0; i &lt; results.FieldCount; i++)
                {
                    switch (fds[i].ToString())
                    {
                        case "gender":
                            string gend = ((Convert.ToBoolean(results[i])) == false) ? "Male" : "Female";
                            field.Add("gender", gend);
                            break;
                        default:
                            field.Add(fds[i], results[i].ToString());
                            break;
                    }
                }
                string status = results[0].ToString();
                user["approved"].Add(zz, field);
                zz++;
            }
</code></pre>

<p>Is there an issue with the way I am setting the three dictionaries at the beginning?
Thanks,</p>

<p>Psy</p>
