C# foreach error
<pre><code>string connection = "Data Source=" + server + ";Initial Catalog=" + dbase + 
";User ID=" + userid + ";Password=" + password;

conn = new SqlConnection(connection);
conn.Open();
SqlCommand cmd = new SqlCommand("SUBNETTEMP", conn);
cmd.CommandType = CommandType.StoredProcedure;

Parameters d = new Parameters();
d.addparam(15, 1);
d.addparam(15, 2);

foreach (var param in d)
{
    cmd.Parameters.Add(new SqlParameter(param.Key, param.Value));
} 
</code></pre>

<p>There's a class called parameters:</p>

<pre><code>class Parameters
{
    Dictionary&lt;int, int&gt; paramids;
    public Dictionary&lt;int, int&gt; addparam(int sid, int sbid)
    {
        if (paramids == null)
            paramids = new Dictionary&lt;int, int&gt;();
        paramids.Add(sid, sbid);
        return paramids;
    }
}
</code></pre>

<p>I am not sure why I am getting error :"foreach statement cannot operate on variables of type 'ConsoleApplication1.Parameters' because 'ConsoleApplication1.Parameter' doesnot contain public definition for GetEnumerator.</p>
