A
amitbadgi
I am gettign this error, while migration an app to asp.net
Exception Details: System.FormatException: Input string was not in a
correct format.
Source Error:
Line 19: Dim enddate = request.QueryString("enddate")
Line 20:
Line 21: if cint(eventid) = "0" then
Line 22: searchtype = 0
Line 23: else
Source File: C:\Documents and
Settings\amit\WebSite1\reports\loc_summary_calc.aspx Line: 21
Stack Trace:
[FormatException: Input string was not in a correct format.]
Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String
Value, NumberFormatInfo NumberFormat) +216
Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String
Value) +91[InvalidCastException: Conversion from string "ns" to type
'Integer' is not valid.]
Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String
Value) +247
Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(Object
Value) +988
ASP.loc_summary_calc_aspx.__Render__control1(HtmlTextWriter __w,
Control parameterContainer) in C:\Documents and
Settings\amit\WebSite1\reports\loc_summary_calc.aspx:21
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,
ICollection children) +98
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +27
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,
ControlAdapter adapter) +53
System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
ControlAdapter adapter) +278
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24The code
isdim eventid, subeventid, cyear, searchalleventeventid =
request.QueryString("VIOSel1")subeventid =
request.QueryString("subvioSel1")cyear =
request.QueryString("cyear")searchallevent =
request.QueryString("searchall")Dim startdate =
request.QueryString("startdate")Dim enddate =
request.QueryString("enddate")
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+8937
The code is as follows,
<%
dim searchtype
'0 - search all zone
'1 - search by zone
'2 - search by location
dim eventid, subeventid, cyear, searchallevent
eventid = request.QueryString("VIOSel1")
subeventid = request.QueryString("subvioSel1")
cyear = request.QueryString("cyear")
searchallevent = request.QueryString("searchall")
Dim startdate = request.QueryString("startdate")
Dim enddate = request.QueryString("enddate")
if cint(eventid).ToString() = 0 then
searchtype = 0
else
if cint(subeventid) = 0 then
searchtype = 1
else
searchtype = 2
end if
end if
Dim Command1__startdate
Command1__startdate = startdate
Dim Command1__enddate
Command1__enddate = enddate
%>
Exception Details: System.FormatException: Input string was not in a
correct format.
Source Error:
Line 19: Dim enddate = request.QueryString("enddate")
Line 20:
Line 21: if cint(eventid) = "0" then
Line 22: searchtype = 0
Line 23: else
Source File: C:\Documents and
Settings\amit\WebSite1\reports\loc_summary_calc.aspx Line: 21
Stack Trace:
[FormatException: Input string was not in a correct format.]
Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String
Value, NumberFormatInfo NumberFormat) +216
Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String
Value) +91[InvalidCastException: Conversion from string "ns" to type
'Integer' is not valid.]
Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String
Value) +247
Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(Object
Value) +988
ASP.loc_summary_calc_aspx.__Render__control1(HtmlTextWriter __w,
Control parameterContainer) in C:\Documents and
Settings\amit\WebSite1\reports\loc_summary_calc.aspx:21
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,
ICollection children) +98
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +27
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,
ControlAdapter adapter) +53
System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
ControlAdapter adapter) +278
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24The code
isdim eventid, subeventid, cyear, searchalleventeventid =
request.QueryString("VIOSel1")subeventid =
request.QueryString("subvioSel1")cyear =
request.QueryString("cyear")searchallevent =
request.QueryString("searchall")Dim startdate =
request.QueryString("startdate")Dim enddate =
request.QueryString("enddate")
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+8937
The code is as follows,
<%
dim searchtype
'0 - search all zone
'1 - search by zone
'2 - search by location
dim eventid, subeventid, cyear, searchallevent
eventid = request.QueryString("VIOSel1")
subeventid = request.QueryString("subvioSel1")
cyear = request.QueryString("cyear")
searchallevent = request.QueryString("searchall")
Dim startdate = request.QueryString("startdate")
Dim enddate = request.QueryString("enddate")
if cint(eventid).ToString() = 0 then
searchtype = 0
else
if cint(subeventid) = 0 then
searchtype = 1
else
searchtype = 2
end if
end if
Dim Command1__startdate
Command1__startdate = startdate
Dim Command1__enddate
Command1__enddate = enddate
%>