title: selecting gridview rows/cells error "input string was not in correct format"
body: <p>I have my gridview set where the user can "select" the row they want which in turn should go through the database and redirect them. However, when I click on "select" for any given row of results I get the error "Input string was not in correct format" at this line: myEvent.EventID = Convert.ToInt32(row.Cells[0].Text);  I took this piece out and I get the error for ever line with the Convert in it. So I know it's not written correctly but I'm unsure how to write it. Any help would be great!</p>
  
  <p>sorry I'm new at this!</p>
  
  <p>My code for the girdview:</p>
  
  <pre><code>protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
      {
          Event myEvent = new Event();
          GridViewRow row = GridView1.SelectedRow;
          myEvent.EventID = Convert.ToInt32(row.Cells[0].Text);
          myEvent.Sport = row.Cells[1].Text;
          myEvent.EventName = row.Cells[2].Text;
          myEvent.Section = Convert.ToInt32(row.Cells[3].Text);
          myEvent.TicketsAvailable = Convert.ToInt32(row.Cells[4].Text);
          myEvent.EventDate = Convert.ToDateTime(row.Cells[5].Text);
          Session["myEvent"] = myEvent;
  
          Response.Redirect("Complete.aspx");
      }
  </code></pre>
  
  <p>My code for the Event in case you need it also:</p>
  
  <pre><code>public class Event
  {
      public int EventID { get; set; }
      public string EventName { get; set; }
      public string Sport { get; set; }
      public int Section { get; set; }
      public int TicketsAvailable { get; set; }
      public DateTime EventDate { get; set; }
  }
  </code></pre>