title: Retrieve stored checkbox value from sql server database to re-enable it
body: <p>I have checkbox value in the gridview which is bound to item template in this manner:</p>
  
  <pre><code>&lt;ItemTemplate&gt;
   &lt;asp:CheckBox ID="CheckBoxDisable" runat="server" AutoPostBack="true" OnCheckedChanged="CheckBoxDisableEvent"/&gt;
  &lt;/ItemTemplate&gt;
  </code></pre>
  
  <p>And i'm implementing the <strong>CheckBoxDisableEvent</strong> method in this manner which does nothing but store the checkbox checked value into sql server table.</p>
  
  <pre><code>        SqlCommand cmd = new SqlCommand("InsertDisableFlagIntoComponents", connection);
          cmd.CommandType = CommandType.StoredProcedure;
          cmd.Parameters.Add("@disableFlag", SqlDbType.Int).Value = disableFlag;
  </code></pre>
  
  <p>Now the problem is when the gridview loads on the start of the project next time, i want to enable all those checkboxes depending upon the value that i have stored in database during previous events.</p>
  
  <p>How can i enable the checkbox values in gridview depending on the values that i stored in sql server table.</p>
  
  <p>BTW i'm using vs2008 with asp.net/C#, sqlserver 2005 </p>
  
  <p>Thanks in anticipation</p>