title: Why isn't my SqlDataSource's UpdateCommand working?
body: <pre><code>&lt;asp:SqlDataSource ID="HopefulDataSource" runat="server" 
      ConnectionString="&lt;%$ ConnectionStrings:MyConnectionString %&gt;" 
      SelectCommand= "SELECT id, regGroupID, amountReceived, other FROM table" 
      UpdateCommand="UPDATE table
                          SET [amountReceived] = @amountReceived
                          WHERE [regGroupID] = @regGroupID"&gt;
      &lt;SelectParameters&gt;
          &lt;asp:ControlParameter ControlID="ddlCourses" Name="ddlSelectedCourse" PropertyName="SelectedValue" Type="String" /&gt;
      &lt;/SelectParameters&gt;
  
      &lt;UpdateParameters&gt;
          &lt;asp:Parameter Name="regGroupID"        Type="Int32" /&gt;
          &lt;asp:Parameter Name="amountReceived"    Type="Decimal" /&gt;
  
          other parameters
  
          &lt;asp:Parameter Name="id"                Type="Int32" /&gt;
      &lt;/UpdateParameters&gt;
  &lt;/asp:SqlDataSource&gt;
  </code></pre>
  
  <p>The above works when I change "WHERE [regGroupID] = @regGroupID" to either</p>
  
  <p>WHERE [id] = @id</p>
  
  <p>or</p>
  
  <p>WHERE [regGroupID] = 2</p>