title: DataKeyNames coming up as undesired Update parameters in ASP.NET GridView
body: <p>I have defined the following in my gridview markup (simplified):</p>
  
  <pre><code>&lt;asp:GridView ID="grvReport" runat="server" DataSourceID="odsReport" 
                  AutoGenerateColumns="False" DataKeyNames="EntryDate,EmployeeNumber"&gt;
  </code></pre>
  
  <p>Then I define my datasource's update parameters as such:</p>
  
  <pre><code>&lt;UpdateParameters&gt;                                
                  &lt;asp:Parameter Name="ID" Type="Int32" /&gt;
                  &lt;asp:Parameter Name="IsJustified" Type="Boolean" /&gt;
                  &lt;asp:Parameter Name="Comment" Type="String" /&gt;                
                  &lt;asp:Parameter Name="LastEditor" Type="String" /&gt;     
   &lt;/UpdateParameters&gt;
  </code></pre>
  
  <p>But when trying to update I get an error saying </p>
  
  <blockquote>
    <p>could not find a non-generic method
    'Update' that has parameters:  ID,
    IsJustified, Comment, LastEditor,
    EntryDate,
    EmployeeNumber.</p>
  </blockquote>
  
  <p>Can I avoid having the fields under DataKey coming up as parameters for my methods?</p>
  
  <p>NOTE: I can work around this by simply modifying my method's parameters and adding the extra values coming from the Gridview and doing nothing with them but it would be nice to have a way to avoid these values even being sent at all.  </p>
  
  <p>Thanks in advance,<br>
  EtonB.</p>