title: SqlDataSource UpdateCommand is not working
body: <p>I have a <strong>GridView</strong> and its DataSource is a <strong>SqlDataSource</strong>. </p>
  
  <pre><code>&lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:ApplicationServices %&gt;"
      UpdateCommand="UPDATE chemlab_Registerkarte SET [Name] =@Name WHERE [regID] =@regID;" OnUpdating="Update"
      SelectCommandType="Text" SelectCommand='select [regID], [Name] from chemlab_Registerkarte;'&gt;
  &lt;/asp:SqlDataSource&gt;
  
  &lt;asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
      DataSourceID="SqlDataSource1" AllowPaging="True" DataKeyNames="regID, Name"&gt;
      &lt;Columns&gt;
          &lt;asp:CommandField ShowEditButton="True" CancelText="&lt;%$ Resources:LocalizedText,TextCancel %&gt;"
              EditText="&lt;%$ Resources:LocalizedText,TextEdit %&gt;" UpdateText="&lt;%$ Resources:LocalizedText,TextSave %&gt;"/&gt;
          &lt;asp:BoundField DataField="regID" HeaderText="regID" ReadOnly="True" SortExpression="regID"
              Visible="true" /&gt;
          &lt;asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name"/&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>My problem is, that it's not updating, although the select command is working fine. </p>
  
  <p>I've looked at this question: 
  <a href="https://stackoverflow.com/questions/15091512/why-isnt-my-sqldatasources-updatecommand-working">Why isn&#39;t my SqlDataSource&#39;s UpdateCommand working?</a> but I have <strong>DataKeyNames</strong> included (as you can see), so this isn't my mistake.</p>
  
  <p>What did I do wrong?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I tried to get the Data out of my GridView using this code:</p>
  
  <pre><code>String[] values = new String[2];    
  values[0] = this.GridView1.Rows[0].Cells[0].Text;
  values[1] = this.GridView1.Rows[0].Cells[1].Text;
  </code></pre>
  
  <p>I get the value when I am not editing it, if I do so I get an empty String. Therefore I cannot even update my database manually.</p>
  
  <p><strong>Edit 2</strong> </p>
  
  <p>I have another site where it's working:</p>
  
  <pre><code>&lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:ApplicationServices %&gt;"
          UpdateCommand="UPDATE chemlab_Anlagen SET Kuerzel =@Kuerzel, Fuellvolumen =@Fuellvolumen, aktiv =@aktiv where aID=@aID;"
          SelectCommandType="Text" SelectCommand='select a.aID, a.InventarNum, m.MO_name, a.Kuerzel, a.Fuellvolumen, a.aktiv from chemlab_Anlagen as a join vw_chemlab_MaintenanceObject as m on a.InventarNum = m.MO_key;'&gt;
      &lt;/asp:SqlDataSource&gt;
  
   &lt;asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
              DataSourceID="SqlDataSource1" AllowPaging="True" DataKeyNames="InventarNum,aID,MO_name"&gt;
              &lt;Columns&gt;
                  &lt;asp:CommandField ShowEditButton="True" CancelText="&lt;%$ Resources:LocalizedText,TextCancel %&gt;"
                      EditText="&lt;%$ Resources:LocalizedText,TextEdit %&gt;" UpdateText="&lt;%$ Resources:LocalizedText,TextSave %&gt;" /&gt;
                  &lt;asp:BoundField DataField="aID" HeaderText="aID" ReadOnly="True" SortExpression="aID"
                      Visible="false" /&gt;
                  &lt;asp:BoundField DataField="InventarNum" HeaderText="InventarNum" ReadOnly="True"
                      SortExpression="InventarNum" /&gt;
                  &lt;asp:BoundField DataField="MO_name" HeaderText="MO_name" SortExpression="MO_name"
                      ReadOnly="true" /&gt;
                  &lt;asp:BoundField DataField="Kuerzel" HeaderText="Kuerzel" SortExpression="Kuerzel" /&gt;
                  &lt;asp:BoundField DataField="Fuellvolumen" HeaderText="Fuellvolumen" SortExpression="Fuellvolumen" /&gt;
                  &lt;asp:CheckBoxField DataField="aktiv" HeaderText="aktiv" SortExpression="aktiv" /&gt;
              &lt;/Columns&gt;
          &lt;/asp:GridView&gt;
  </code></pre>