System.FormatException: Input string was not in a correct format.

O

orangeatmsdn

This is another exception that worked fine in 1.1 .NET framework env, but
when I nove this code to 2.0 .NET framework env it fails (looking for
documentation or recommendations to resolve the issue) -- is it possible that
there is a conversion guideline or some notes that I need to be using for
what has changed, I am not sure what to fix here):

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 126: ASRTqIcRtgDataEntryUserControl tempcontrol1;
Line 127: System.Collections.IEnumerator en1;
Line 128: int userStatus=Int32.Parse(this.TextBox9.Text.ToString());
Line 129:
Line 130: en1 = this.Panel1.Controls.GetEnumerator();


Source File: C:\VZOASR\VZOASR\rasr\controls\ASRTqIcRtgUserControl.ascx.cs
Line: 128

Stack Trace:


[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options,
NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2725283
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo
info) +102
System.Int32.Parse(String s) +20
rasr.controls.ASRTqIcRtgUserControl.Page_Load(Object sender, EventArgs e)
in C:\VZOASR\VZOASR\rasr\controls\ASRTqIcRtgUserControl.ascx.cs:128
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
 
A

Arne Vajhøj

orangeatmsdn said:
This is another exception that worked fine in 1.1 .NET framework env, but
when I nove this code to 2.0 .NET framework env it fails (looking for
documentation or recommendations to resolve the issue) -- is it possible that
there is a conversion guideline or some notes that I need to be using for
what has changed, I am not sure what to fix here):

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.
Line 128: int userStatus=Int32.Parse(this.TextBox9.Text.ToString());
[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options,
NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2725283
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo
info) +102
System.Int32.Parse(String s) +20
rasr.controls.ASRTqIcRtgUserControl.Page_Load(Object sender, EventArgs e)
in C:\VZOASR\VZOASR\rasr\controls\ASRTqIcRtgUserControl.ascx.cs:128

Are you sure that there are not entered different input in TextBox9 ??

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top