error code regarding saying wrong format in asp.net c#
<p>Please can someone help me I keep getting this error which its telling me its not in the correct format but I have it listed as an integer.  You will be my hero for real if you could tell me what I'm being a moron about.  I'm sure grateful for anyone's help and yes I'm just starting out somewhat in asp.net so please forgive me.</p>

<p>The page is a survey that gets the incidents from a customer id.  It uses a sqlconnection and is fine up until I hit the submit button and then error.</p>

<p>This is the error code I keep getting and I guess I'm just not seeing it.  I don't understand why it is causing this error which I'm figuring is going to be a problem with the selected value.  For what its worth I added the if statement just before it hoping that this was the problem but obviously not.</p>

<pre><code>Input string was not in a correct format. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.

FormatException: Input string was not in a correct format.

Source Error: 

Line 56:             s.CustomerID = Convert.ToInt32(txtCustomerID.Text);
Line 57:             if (lstIncident.SelectedIndex &gt; -1)
Line 58:                 s.IncidentID = Convert.ToInt32(lstIncident.SelectedValue);
Line 59:             if (rblResponse.SelectedIndex != -1)
Line 60:             {
</code></pre>

<p>Behind the code for the page</p>

<pre><code>public partial class CustomerSurvey : System.Web.UI.Page
{
private DataView IncidentsTable;
protected void Page_Load(object sender, EventArgs e)
{
    txtCustomerID.Focus();
}
protected void btnGetIncidents_Click(object sender, EventArgs e)
{

    IncidentsTable = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
    IncidentsTable.RowFilter = "CustomerID = " + Convert.ToInt32(txtCustomerID.Text) + " AND DateClosed is Not Null";

    if (IncidentsTable.Count &gt; 0)
    {
        this.DisplayIncidents();
        this.Enable(true);
        lstIncident.Focus();
    }
    else
    {
        lblIncidentCount.Text = "I'm sorry there are no incidents that can be surveyed at this time.";
        this.Enable(false);
    }
}

private void DisplayIncidents()
{
    lstIncident.Items.Add(new ListItem("--Select an Incident--"));
    for (int j = 0; j &lt; IncidentsTable.Count; j++)
    {
        DataRowView row = IncidentsTable[j];
        Incident i = new Incident();
        i.IncidentID = Convert.ToInt32(row["IncidentID"]);
        i.ProductCode = row["ProductCode"].ToString();
        i.DateClosed = Convert.ToDateTime(row["DateClosed"]);
        i.Title = row["Title"].ToString();
        lstIncident.Items.Add(i.CustomerIncidentDisplay());
    }
    lstIncident.SelectedIndex = 0;
    lblIncidentCount.Text = "";
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
    if (Page.IsValid)
    {
        Survey s = new Survey();
        s.CustomerID = Convert.ToInt32(txtCustomerID.Text);
        if (lstIncident.SelectedIndex &gt; -1)
            s.IncidentID = Convert.ToInt32(lstIncident.SelectedValue);
        if (rblResponse.SelectedIndex != -1)
        {
            s.ResponseTime = Convert.ToInt32(rblResponse.SelectedValue);
        }
        if (rblTechEfficiency.SelectedIndex != -1)
        {
            s.TechEfficiency = Convert.ToInt32(rblTechEfficiency.SelectedValue);
        }
        if (rblProblemResolution.SelectedIndex != -1)
        {
            s.Resolution = Convert.ToInt32(rblProblemResolution.SelectedValue);
        }
        s.Comments = txtComments.Text;
        if (ckbContactMe.Checked)
        {
            s.Contact = true;
            if (rdoContactEmail.Checked)
            {
                s.ContactBy = "Email";
            }
            else
            {
                s.ContactBy = "Phone";
            }
            Session.Add("Contact", true);
        }
        else
        {
            s.Contact = false;
            Session.Add("Contact", false);
        }
        Response.Redirect("SurveyComplete.aspx");
    }
}
private void Enable(bool e)
{
    lstIncident.Enabled = e;
    lblIncidents.Enabled = e;
    lblResponse.Enabled = e;
    lblProblemResolution.Enabled = e;
    lblTechEfficiency.Enabled = e;
    lblComments.Enabled = e;
    rdoContactEmail.Enabled = e;
    rdoContactPhone.Enabled = e;
    rblProblemResolution.Enabled = e;
    rblResponse.Enabled = e;
    rblTechEfficiency.Enabled = e;
    lblContact.Enabled = e;
    txtComments.Enabled = e;
    ckbContactMe.Enabled = e;
    btnSubmit.Enabled = e;
}
</code></pre>

<p>}</p>

<p>Here is my class called Incident</p>

<pre><code>public class Incident
{
public int IncidentID { get; set; }
public int CustomerID { get; set; }
public string ProductCode { get; set; }
public int TechID { get; set; }
public string DateOpened { get; set; }
public DateTime DateClosed { get; set; }
public string Title { get; set; }
public string Description { get; set; }

    public string CustomerIncidentDisplay()
    {
    return "Incident for product " + ProductCode + " closed " + DateClosed.ToShortDateString() +
        " (" + Title + ")";
    }
} 
    public Incident()
{

}
</code></pre>

<p>This is from a master page but here is the page</p>

<pre><code>&lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"&gt;
    &lt;label&gt;Enter your customer ID:&lt;/label&gt;&amp;nbsp;&amp;nbsp;
    &lt;asp:TextBox ID="txtCustomerID" runat="server" Width="183px"&gt;&lt;/asp:TextBox&gt;&amp;nbsp;&amp;nbsp;
    &lt;asp:Button ID="btnGetIncidents" runat="server" Text="Get Incidents" OnClick="btnGetIncidents_Click" ValidationGroup="CustomerID" /&gt;
    &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCustomerID" ErrorMessage="You must enter a customer ID" ForeColor="Red" ValidationGroup="CustomerID" Display="Dynamic"&gt;&lt;/asp:RequiredFieldValidator&gt;
    &lt;asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtCustomerID" ErrorMessage="Customer ID must be a positive whole number" ForeColor="Red" Operator="DataTypeCheck" Type="Integer" ValidationGroup="CustomerID" Display="Dynamic"&gt;&lt;/asp:CompareValidator&gt;
    &lt;br /&gt;
    &lt;asp:Label ID="lblIncidentCount" runat="server" ForeColor="Red"&gt;&lt;/asp:Label&gt;
    &lt;br /&gt;
    &lt;asp:ListBox ID="lstIncident" runat="server" Width="622px" Enabled="False" AutoPostBack="True"&gt;&lt;/asp:ListBox&gt;
    &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:TechSupportConnectionString %&gt;" SelectCommand="SELECT [IncidentID], [CustomerID], [ProductCode], [TechID], [DateOpened], [DateClosed], [Title] FROM [Incidents] ORDER BY [DateClosed]"&gt;&lt;/asp:SqlDataSource&gt;
    &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="lstIncident" ErrorMessage="You must select an incident" ForeColor="Red" ValidationGroup="Incidents" Display="Dynamic" &gt;&lt;/asp:RequiredFieldValidator&gt;
    &lt;br /&gt;
    &lt;asp:Label ID="lblIncidents" runat="server" Text="Please rate this incident by the following categories: " Enabled="False"&gt;&lt;/asp:Label&gt;&lt;br /&gt;
   &lt;table id="tblIncidents"&gt;
        &lt;tr&gt;
            &lt;td&gt; &lt;asp:Label ID="lblResponse" runat="server" Text="Response Time:" Enabled="False"&gt;&lt;/asp:Label&gt;&lt;/td&gt;
            &lt;td&gt;&lt;asp:RadioButtonList ID="rblResponse" runat="server" Font-Names="Arial" Font-Size="Small" RepeatDirection="Horizontal" Enabled="False"&gt;
                &lt;asp:ListItem Value="1"&gt;Not Satisfied&lt;/asp:ListItem&gt;
                &lt;asp:ListItem Value="2"&gt;Somewhat Satisfied&lt;/asp:ListItem&gt;
                &lt;asp:ListItem Value="3"&gt;Satisfied&lt;/asp:ListItem&gt;
                &lt;asp:ListItem Value="4"&gt;Completely Satisfied&lt;/asp:ListItem&gt;
            &lt;/asp:RadioButtonList&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;asp:Label ID="lblTechEfficiency" runat="server" Text="Technician Efficiency:" Enabled="False"&gt;&lt;/asp:Label&gt;&lt;/td&gt;
            &lt;td&gt;&lt;asp:RadioButtonList ID="rblTechEfficiency" runat="server" RepeatDirection="Horizontal" Font-Names="Arial" Font-Size="Small" Enabled="False"&gt;
                &lt;asp:ListItem Value="1"&gt;Not Satisfied&lt;/asp:ListItem&gt;
                &lt;asp:ListItem Value="2"&gt;Somewhat Satisfied&lt;/asp:ListItem&gt;
                &lt;asp:ListItem Value="3"&gt;Satisfied&lt;/asp:ListItem&gt;
                &lt;asp:ListItem Value="4"&gt;Completely Satisfied&lt;/asp:ListItem&gt;
            &lt;/asp:RadioButtonList&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;asp:Label ID="lblProblemResolution" runat="server"  Text="Problem Resolution:" Enabled="False"&gt;&lt;/asp:Label&gt;&lt;/td&gt;
            &lt;td&gt;&lt;asp:RadioButtonList ID="rblProblemResolution" runat="server" RepeatDirection="Horizontal" Font-Names="Arial" Font-Size="Small" Enabled="False"&gt;
                &lt;asp:ListItem Value="1"&gt;Not Satisfied&lt;/asp:ListItem&gt;
                &lt;asp:ListItem Value="2"&gt;Somewhat Satisfied&lt;/asp:ListItem&gt;
                &lt;asp:ListItem Value="3"&gt;Satisfied&lt;/asp:ListItem&gt;
                &lt;asp:ListItem Value="4"&gt;Completely Satisfied&lt;/asp:ListItem&gt;
            &lt;/asp:RadioButtonList&gt;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
   &lt;asp:Label ID="lblComments" runat="server" Text="Additional Comments:" Enabled="False"&gt;&lt;/asp:Label&gt;
   &lt;asp:TextBox ID="txtComments" runat="server" Height="81px" Width="551px" Enabled="False" Rows="4" TextMode="MultiLine"&gt;&lt;/asp:TextBox&gt;
        &lt;br /&gt;
        &lt;br /&gt;

    &lt;asp:CheckBox ID="ckbContactMe" runat="server" Enabled="False" /&gt;
    &lt;asp:Label ID="lblContact" runat="server" Text="Please contact me to discuss this incident" Enabled="False"&gt;&lt;/asp:Label&gt;
    &lt;br /&gt;
    &lt;asp:RadioButton ID="rdoContactEmail" runat="server" GroupName="ContactBy" Enabled="False" Text="Contact By Email" /&gt;&lt;br /&gt;
    &lt;asp:RadioButton ID="rdoContactPhone" runat="server" Enabled="False" GroupName="ContactBy" Text="Contact By Phone" /&gt;

    &lt;br /&gt;
    &lt;br /&gt;
    &lt;asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Text="Submit" Enabled="False" ValidationGroup="Incidents" Width="123px" /&gt;
&lt;/asp:Content&gt;
</code></pre>
