title: Update Gridview Error - "oldValues is empty"
body: <p>So I'm trying to update my GridView, and I get this error:</p>
  
  <blockquote>
    <p>You have specified that your update command compares all values on
    SqlDataSource 'SqlDataSource1', but the dictionary passed in for
    oldValues is empty.  Pass in a valid dictionary for update or change
    your mode to OverwriteChanges.</p>
  </blockquote>
  
  <p>Here is the SQL Data Source in question:</p>
  
  <pre><code> &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                  ConflictDetection="CompareAllValues" 
                  ConnectionString="&lt;%$ ConnectionStrings:MyConnectionString %&gt;" 
                  OldValuesParameterFormatString="original_{0}" 
                  SelectCommand="SELECT field1, field2, field3, field4, field5, field6 
                      FROM table 
                      ORDER BY field4"
                  UpdateCommand="UPDATE table2 
                      SET field2 = @field2 , field3 = @field3, field4 = @field4  
                      WHERE (field1 = @original_field1) AND (field6 = @original_field6)"
                  FilterExpression="field1 LIKE '{0}'"&gt;
                  &lt;FilterParameters&gt;
                      &lt;asp:ControlParameter ControlID="SearchBox" Name="field1" Type="String" DefaultValue="" /&gt;
                  &lt;/FilterParameters&gt;
                  &lt;SelectParameters&gt;
                       &lt;asp:ControlParameter ControlID="SearchBox" Name="field1" Type="String" DefaultValue="" /&gt;  
                  &lt;/SelectParameters&gt;
                  &lt;UpdateParameters&gt;
                      &lt;asp:Parameter Name="field2" Type="String" /&gt;
                      &lt;asp:Parameter Name="field3" Type="String" /&gt;
                      &lt;asp:Parameter Name="field4" Type="Int32" /&gt;
                      &lt;asp:Parameter Name="original_field1" Type="String" /&gt;
                      &lt;asp:Parameter Name="original_field5" Type="Int32" /&gt;
                      &lt;asp:Parameter Name="original_field2" Type="String" /&gt;
                      &lt;asp:Parameter Name="original_field3" Type="String" /&gt;
                      &lt;asp:Parameter Name="original_field4" Type="Int32" /&gt;
                      &lt;asp:Parameter Name="original_field6" Type="Int32" /&gt;
                  &lt;/UpdateParameters&gt;
   &lt;/asp:SqlDataSource&gt;
  </code></pre>
  
  <p>Now I understand one way to get around this is to change 'CompareAllValues' to 'OverwriteChanges', however I have never needed to do this before (I have other GridViews on the page that update just fine) and it never seems to update the data when I DO try anyway. 
  Is it the nature of the data that would cause this Data Source to act differently to the rest? Or have I done something stupid? </p>
  
  <p>Thanks! :)</p>