Note that there are some explanatory texts on larger screens.

plurals
  1. POInput string was not in correct format?
    text
    copied!<p>When I run my C# code, I get this error: Input string was not in a correct format. and it highlights this code:</p> <pre><code> theTWAValue=Convert.ToInt32(theTWALabel.Text); </code></pre> <p>why is that happening?</p> <p>Additional info:</p> <p>The entire C# function:</p> <pre><code> &lt;script runat="server"&gt; protected void YourListView_Load(object sender, EventArgs e) { Label theTWALabel; int theTWAValue; foreach (ListViewItem item in YourListView.Items) { theTWALabel = (Label)item.FindControl("TWALabel"); theTWAValue = Convert.ToInt32(theTWALabel.Text); if (theTWAValue &gt;= 0) { if (theTWAValue &lt; 90) theTWALabel.ForeColor = System.Drawing.Color.Yellow; else theTWALabel.ForeColor = System.Drawing.Color.Red; } } } &lt;/script&gt; </code></pre> <p>Here is the rest of the code: </p> <pre><code>&lt;asp:SqlDataSource id="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:2007 SoundAssist VER 1.0.5 05-12-2011 ( 2013-06-24)ConnectionString %&gt;" ProviderName="&lt;%$ ConnectionStrings:2007 SoundAssist VER 1.0.5 05-12-2011 ( 2013-06-24)ConnectionString.ProviderName %&gt;" SelectCommand="SELECT [Plant] FROM [PLANT]"&gt; &lt;/asp:SqlDataSource&gt; &lt;asp:DropDownList id="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="Plant" DataValueField="Plant" Height="85px" Width="393px"&gt; &lt;/asp:DropDownList&gt; &lt;asp:SqlDataSource id="SqlDataSource2" runat="server" ConnectionString="&lt;%$ ConnectionStrings:2007 SoundAssist VER 1.0.5 05-12-2011 ( 2013-06-24)ConnectionString %&gt;" ProviderName="&lt;%$ ConnectionStrings:2007 SoundAssist VER 1.0.5 05-12-2011 ( 2013-06-24)ConnectionString.ProviderName %&gt;" SelectCommand="SELECT [Plant], [Group No#] AS column1, [Group] FROM [Temp Table that contains TWA values] WHERE ([Plant] = ?)"&gt; &lt;SelectParameters&gt; &lt;asp:ControlParameter ControlID="DropDownList1" Name="Plant" PropertyName="SelectedValue" Type="String" /&gt; &lt;/SelectParameters&gt; &lt;/asp:SqlDataSource&gt; &lt;asp:DropDownList id="DropDownList2" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2" DataTextField="Group" DataValueField="column1" Height="30px" Width="394px"&gt; &lt;/asp:DropDownList&gt; &lt;asp:SqlDataSource id="SqlDataSource3" runat="server" ConnectionString="&lt;%$ ConnectionStrings:2007 SoundAssist VER 1.0.5 05-12-2011 ( 2013-06-24)ConnectionString %&gt;" ProviderName="&lt;%$ ConnectionStrings:2007 SoundAssist VER 1.0.5 05-12-2011 (2013-06-24)ConnectionString.ProviderName %&gt;" SelectCommand="SELECT [Plant], [Group No#] AS column1, [Group], [Job Code] AS Job_Code, [Job Function] AS Job_Function, [Job Classification] AS Job_Classification FROM [Temp Table that contains TWA values] WHERE (([Plant] = ?) AND ([Group No#] = ?))"&gt; &lt;SelectParameters&gt; &lt;asp:ControlParameter ControlID="DropDownList1" Name="Plant" PropertyName="SelectedValue" Type="String" /&gt; &lt;asp:ControlParameter ControlID="DropDownList2" Name="column1" PropertyName="SelectedValue" Type="String" /&gt; &lt;/SelectParameters&gt; &lt;/asp:SqlDataSource&gt; &lt;asp:DropDownList id="DropDownList3" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource3" DataTextField="Job_Classification" DataValueField="Job_Classification" Height="17px" Width="384px"&gt; &lt;/asp:DropDownList&gt; &lt;asp:ListView id="YourListView" OnLoad="YourListView_Load" runat="server" DataSourceID="SqlDataSource4"&gt; &lt;ItemTemplate&gt; &lt;span style=""&gt;Plant: &lt;asp:Label id="PlantLabel" runat="server" Text='&lt;%# Eval("Plant") %&gt;' /&gt; &lt;br /&gt; column1: &lt;asp:Label id="column1Label" runat="server" Text='&lt;%# Eval("column1") %&gt;' /&gt; &lt;br /&gt; Group: &lt;asp:Label id="GroupLabel" runat="server" Text='&lt;%# Eval("Group") %&gt;' /&gt; &lt;br /&gt; Job_Code: &lt;asp:Label id="Job_CodeLabel" runat="server" Text='&lt;%# Eval("Job_Code") %&gt;' /&gt; &lt;br /&gt; Job_Classification: &lt;asp:Label id="Job_ClassificationLabel" runat="server" Text='&lt;%# Eval("Job_Classification") %&gt;' /&gt; &lt;br /&gt; Job_Function: &lt;asp:Label id="Job_FunctionLabel" runat="server" Text='&lt;%# Eval("Job_Function") %&gt;' /&gt; &lt;br /&gt; Job_Description: &lt;asp:Label id="Job_DescriptionLabel" runat="server" Text='&lt;%# Eval("Job_Description") %&gt;' /&gt; &lt;br /&gt; TWA: &lt;asp:Label id="TWALabel" runat="server" Text='&lt;%# Eval("TWA") %&gt;' /&gt; &lt;br /&gt; &lt;br /&gt; &lt;/span&gt; &lt;/ItemTemplate&gt; &lt;/asp:ListView&gt; &lt;asp:SqlDataSource id="SqlDataSource4" runat="server" ConnectionString="&lt;%$ ConnectionStrings:2007 SoundAssist VER 1.0.5 05-12-2011 ( 2013-06-24)ConnectionString %&gt;" ProviderName="&lt;%$ ConnectionStrings:2007 SoundAssist VER 1.0.5 05-12-2011 ( 2013-06-24)ConnectionString.ProviderName %&gt;" SelectCommand="SELECT [Plant], [Group No#] AS column1, [Group], [Job Code] AS Job_Code, [Job Classification] AS Job_Classification, [Job Function] AS Job_Function, [Job Description] AS Job_Description, [TWA] FROM [Temp Table that contains TWA values] WHERE (([Plant] = ?) AND ([Group No#] = ?) AND ([Job Classification] = ?))"&gt; &lt;SelectParameters&gt; &lt;asp:ControlParameter ControlID="DropDownList1" Name="Plant" PropertyName="SelectedValue" Type="String" /&gt; &lt;asp:ControlParameter ControlID="DropDownList2" Name="column1" PropertyName="SelectedValue" Type="String" /&gt; &lt;asp:ControlParameter ControlID="DropDownList3" Name="Job_Classification" PropertyName="SelectedValue" Type="String" /&gt; &lt;/SelectParameters&gt; &lt;/asp:SqlDataSource&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload