asp to asp.net input string error


A

amitbadgi

Welcome back amitbadgi | Logout | Faq
Knowledge Discovery Keys
COMPUTER PROGRAMMING, DATA MINING, STATISTICS, ARTIFICIAL INTELLIGENCE

* Settings
* Photos
* Lists
* MVPs
* Forums
* Blogs
* Home


ASP.NET
Started by amitbadgi at 08-09-2005 22:07. Topic has 0 replies.
Knowledge Disc... » NET Framework, ... » ASP.NET » asp to asp.net
input string error

Print Search
Search
Disable E-mail Replies
Sort Posts:
Yesterday, 22:07
amitbadgi is not online. Last active: 8/2/2005 3:47:26 PM amitbadgi

Top 50 Posts
Joined on 06-16-2005
Bronze Member

asp to asp.net input string error
Thread Status: Reply Quote


While converting an asp to asp.net i am getting teh foll error,

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

Source Error:

Line 188: do until rs_user.eof Line
189: 'if (IsDBNull(current_dept.Value) <> true) then
Line 190: if (current_dept <>
rs_user.Fields.Item("department").value)then
Line 191: response.Write("<tr><td colspan=""7""><br><b><u>" &
(rs_user.Fields.Item("deptname").Value) & "</u></b></td></tr>")Line
192: current_dept = (rs_user.Fields.Item("department").Value)


Source File: C:\Documents and Settings\amit\WebSite1\list_users.aspx
Line: 190

Stack Trace:

[FormatException: Input string was not in a correct format.]
Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String
Value, NumberFormatInfo NumberFormat) +211
Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String
Value, NumberFormatInfo NumberFormat) +74[InvalidCastException:
Conversion from string "" to type 'Double' is not valid.]
Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String
Value, NumberFormatInfo NumberFormat) +218
Microsoft.VisualBasic.CompilerServices.Operators.CompareObject2(Object
Left, Object Right, Boolean TextCompare) +3020
Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectNotEqual(Object
Left, Object Right, Boolean TextCompare) +25
ASP.list_users_aspx.__Render__control1(HtmlTextWriter __w, Control
parameterContainer) in C:\Documents and
Settings\amit\WebSite1\list_users.aspx:190
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) +280
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+8878

Thankyou
 
Ad

Advertisements

G

Guest

You should rewrite the data manipulation for ADO.NET instead of using
Interop. It is less buggy and will perform much better.

If you MUST stay in ADO, you will have some issues. It is better to pull the
value and then compare rather than attempt the pull and compare in the same
statement. You can then debug what is causing the error, as it will break on
one or the other.

As it stands, my guess is the recordset value is being pulled as a string
and compared against a different data type. As the code is not ADO.NET, but
it is being used in the .NET world, I am not surprised.

Photos
* Lists
* MVPs
* Forums
* Blogs
* Home


ASP.NET
Started by amitbadgi at 08-09-2005 22:07. Topic has 0 replies.
Knowledge Disc... » NET Framework, ... » ASP.NET » asp to asp.net
input string error

Print Search
Search
Disable E-mail Replies
Sort Posts:
Yesterday, 22:07
amitbadgi is not online. Last active: 8/2/2005 3:47:26 PM amitbadgi

Top 50 Posts
Joined on 06-16-2005
Bronze Member

asp to asp.net input string error
Thread Status: Reply Quote


While converting an asp to asp.net i am getting teh foll error,

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

Source Error:

Line 188: do until rs_user.eof Line
189: 'if (IsDBNull(current_dept.Value) <> true) then
Line 190: if (current_dept <>
rs_user.Fields.Item("department").value)then
Line 191: response.Write("<tr><td colspan=""7""><br><b><u>" &
(rs_user.Fields.Item("deptname").Value) & "</u></b></td></tr>")Line
192: current_dept = (rs_user.Fields.Item("department").Value)


Source File: C:\Documents and Settings\amit\WebSite1\list_users.aspx
Line: 190

Stack Trace:

[FormatException: Input string was not in a correct format.]
Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String
Value, NumberFormatInfo NumberFormat) +211
Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String
Value, NumberFormatInfo NumberFormat) +74[InvalidCastException:
Conversion from string "" to type 'Double' is not valid.]
Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String
Value, NumberFormatInfo NumberFormat) +218
Microsoft.VisualBasic.CompilerServices.Operators.CompareObject2(Object
Left, Object Right, Boolean TextCompare) +3020
Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectNotEqual(Object
Left, Object Right, Boolean TextCompare) +25
ASP.list_users_aspx.__Render__control1(HtmlTextWriter __w, Control
parameterContainer) in C:\Documents and
Settings\amit\WebSite1\list_users.aspx:190
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) +280
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+8878

Thankyou
[/QUOTE]
 

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