title: Gridview Item has already been added error
body: <p>First of all, I've seen that simliar questions have been asked and believe me, I've read the answers and comments and tried to understand. Otherwise I wouldn't post.</p>
  
  <p>So, the question then:</p>
  
  <p>I have a gridview that I wish to update. </p>
  
  <p><strong>The ASP code looks like this:</strong></p>
  
  <pre><code>&lt;asp:GridView ID="myGv" runat="server" 
      AutoGenerateEditButton="true" AutoGenerateDeleteButton="true" 
      AutoGenerateColumns="False" AllowPaging="true" AllowSorting="true" DataKeyNames="id" DataSourceID="myObjectDataSource"
      OnRowUpdating="myGv_RowUpdating" &gt;
      &lt;Columns&gt;
          &lt;asp:BoundField DataField="id" HeaderText="id" Visible="false" InsertVisible="False" ReadOnly="True" SortExpression="id" /&gt;
          &lt;asp:BoundField DataField="type" HeaderText="type" SortExpression="type" ReadOnly="True" /&gt;
          &lt;asp:BoundField DataField="date" HeaderText="date" SortExpression="date" ReadOnly="True" /&gt;
          &lt;asp:BoundField DataField="volume" HeaderText="volume" SortExpression="volume" /&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p><strong>This is the ObjectDataSource:</strong></p>
  
  <pre><code>&lt;asp:ObjectDataSource ID="myObjectDataSource" runat="server" 
      DeleteMethod="myDeleteMethod" SelectMethod="mySelectMethod" 
      TypeName="url.sqlDataLayer" UpdateMethod="myUpdateMethod"&gt;
      &lt;DeleteParameters&gt;
          &lt;asp:Parameter Name="id" Type="Int32" /&gt;
      &lt;/DeleteParameters&gt;
      &lt;SelectParameters&gt;
          &lt;asp:Parameter Name="fromDate" Type="DateTime" /&gt;
          &lt;asp:Parameter Name="toDate" Type="DateTime" /&gt;
      &lt;/SelectParameters&gt;
      &lt;UpdateParameters&gt;
          &lt;asp:Parameter Name="id" Type="Int32" /&gt;
          &lt;asp:Parameter Name="volume" Type="Int32" /&gt;
      &lt;/UpdateParameters&gt;
  &lt;/asp:ObjectDataSource&gt;
  </code></pre>
  
  <p><strong>And here is the code behind (C#):</strong></p>
  
  <pre><code>protected void myGv_RowUpdating(object sender, GridViewUpdateEventArgs e)
  {
      GridViewRow row = (GridViewRow)myGv.Rows[e.RowIndex];
  
      string value = ((TextBox)(row.Cells[3].Controls[0])).Text;
  
      e.NewValues.Add("volume", value);
  }
  </code></pre>
  
  <p>I have this other page in the same namespace that has the exact same layout (with the same column names) which is probably causing the error.</p>
  
  <p><strong>This is the errorcode:</strong></p>
  
  <pre><code>Item has already been added. Key in dictionary: 'volume'  Key being added: 'volume'
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
  
  Exception Details: System.ArgumentException: Item has already been added. Key in dictionary: 'volume'  Key being added: 'volume'
  </code></pre>
  
  <p><strong>And the stack trace:</strong></p>
  
  <pre><code>[ArgumentException: Item has already been added. Key in dictionary: 'volume'  Key being added: 'volume']
     System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) +14349425
     System.Collections.Specialized.OrderedDictionary.Add(Object key, Object value) +144
     namespace.class.myGv_RowUpdating(Object sender, GridViewUpdateEventArgs e) in theurl.aspx.cs:55
     System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +1157
     System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +762
     System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +164
     System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +84
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
  </code></pre>