title: Storing Contents from database in c# control
body: <p>i have a function called ViewComments() which retrieve contents from database using SQL commands</p>
  
  <pre><code>     private void ViewComments()
       {           
          hookUp = new SqlConnection("Server=XXXX\\SQLEXPRESS;Database=WebExcerciseDB;" + "Integrated Security=True");
          SqlCmd = new SqlCommand("SELECT PersonName,PersonMail,Comment FROM CommentsTable", hookUp);
          try
          {
              hookUp.Open();
  
              reader = SqlCmd.ExecuteReader();
              while (reader.Read())
              {
                  SQL_Result.Text += reader["PersonName"] + "  " + reader["PersonMail"] + "  " + reader["Comment"] + Convert.ToString(reader["PostDate"]) + "&lt;br/&gt;";
              }
          }
          catch (Exception)
          {
              MessageBox.Show("Error in database code\n");
  
          }
          finally
          {
              reader.Close();
              hookUp.Close();
          }
      }
  </code></pre>
  
  <p>i want to store the contents in <code>IList&lt;&gt;</code> control, how to do that?</p>
  
  <p>thanks any way..</p>