title: "An entry with the same key already exists" exception in sortedlist entry in c#
body: <p>Check the below function I'm getting an exception when running the program like </p>
  
  <blockquote>
    <p>"An entry with the same key already exists".</p>
  </blockquote>
  
  <p>Inside the if condition. but i think there is no chance for the same key exception. Please help me to find the solution.</p>
  
  <pre><code>int loop=0;
  string a;
  string b;
  string c;
  string d;
  string e;
  string f; 
  
  public void function()
  {
     loop++;
     int i = -1;
     while(i&gt;0)
     {
          string[] strDataArray = new string[]  {a,b,c,d,e,f};
          SortedList&lt;decimal, string[]&gt; slData = new SortedList&lt;decimal, string[]&gt;();
  
          slData = dicData[dicIP[socCurrentSocket.RemoteEndPoint.ToString()]];
          if (!slData.ContainsKey(ConvertToDecimal(0013b84b83a6) + loop))
                          slData.Add(ConvertToDecimal(0013b84b83a6) + loop, strDataArray);
      }
    }
  </code></pre>