title: How do I populate my CheckBoxList with values from my database?
body: <p>How do I set the <code>CheckBoxList</code> values with my values stored in my database? 
  I have tried using a <code>datareader</code> but it doesn't work and I don't know why.</p>
  
  <p>My Code:</p>
  
  <pre><code>cmd = new SqlCommand("SELECT [SeatID], [Flag] FROM [SeatingPlan] WHERE ([SectionID] = 1 )", con);
  dr = cmd.ExecuteReader();
  while (dr.Read())
  {
      for (int i = 0; i &lt; 15; i++)
      {
          if (dr.GetString(1).Equals("true"))
          {
              chkBoxDaysList.Items[i].Selected = true;
              chkBoxDaysList.Items[i].Enabled = false;
          }
      }
  }
  </code></pre>