title: Gridview not populating while using a While() structure. C# ASP.Net
body: <p>I am having problems with this grid view.  I am populating it with a query.  However, it will not populate or even appear if I use a while(reader.Read()) structure.  Without the while structure, it works fine.  However, I need to access two specific fields.  The code is below.</p>
  
  <pre><code> SqlDataReader myReader;
   try
   {
       using (myConnection)
       {
           myConnection.Open();
           ArrayList arrliGames = new ArrayList();
           myReader = myCommand.ExecuteReader();
  
           decimal decTicketCost = 0;
           int intTicketCount = 0;
  
           while (myReader.Read ())
           {
               decTicketCost = Convert .ToDecimal (myReader ["TicketCost"]);
               intTicketCount =Convert .ToInt32 (myReader ["NumTickets"]);
           }
  
           //Binds listbox
           grdEvents.DataSource = myReader ;
           grdEvents.DataBind();
       }
   }
  </code></pre>