title: Update gridview to sql table all at once
body: <p>So I have a gridview in an ASP webpage that I want to periodically update all at once to the sql server. </p>
  
  <p>Each cell consists of a textbox in a templatefield like so:</p>
  
  <pre><code> &lt;asp:TemplateField HeaderText="Item" HeaderStyle-CssClass="pinnedcol" ControlStyle-Width="160px"&gt;
        &lt;ItemTemplate&gt;
             &lt;asp:TextBox runat="server" Text='&lt;%# Bind("item") %&gt;'
               ID="txtfocus" SelectedRowStyle="myselection" AutoPostBack="true"&gt;&lt;/asp:TextBox&gt;
        &lt;/ItemTemplate&gt;
        &lt;HeaderStyle HorizontalAlign="Center" /&gt;
        &lt;ItemStyle HorizontalAlign="Center" /&gt;
   &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>I have a timer set to update the sql server every 2 minutes, but I don't know how I should create an update command when the timer ticks. The table is quite large at 30 rows by 26 columns, so it seems impractical to compile a list of update statements that long. Is there a method that I  can invoke where it can track user modifications to the gridview and then update all at once to the sql server?</p>