473,396 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

asp to asp.net input string error


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.C ompareObject2(Object
Left, Object Right, Boolean TextCompare) +3020
Microsoft.VisualBasic.CompilerServices.Operators.C onditionalCompareObjectNotEqual(Object
Left, Object Right, Boolean TextCompare) +25
ASP.list_users_aspx.__Render__control1(HtmlTextWri ter __w, Control
parameterContainer) in C:\Documents and
Settings\amit\WebSite1\list_users.aspx:190
System.Web.UI.Control.RenderChildrenInternal(HtmlT extWriter writer,
ICollection children) +98
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +27
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter 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

Nov 19 '05 #1
1 1818
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.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"am*******@gmail.com" wrote:

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.C ompareObject2(Object
Left, Object Right, Boolean TextCompare) +3020
Microsoft.VisualBasic.CompilerServices.Operators.C onditionalCompareObjectNotEqual(Object
Left, Object Right, Boolean TextCompare) +25
ASP.list_users_aspx.__Render__control1(HtmlTextWri ter __w, Control
parameterContainer) in C:\Documents and
Settings\amit\WebSite1\list_users.aspx:190
System.Web.UI.Control.RenderChildrenInternal(HtmlT extWriter writer,
ICollection children) +98
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +27
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter 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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: WindAndWaves | last post by:
Hi Gurus In my quest in putting my first javascript together, I am now trying to conquer something that seems trivial, but has taken me hours. I would like to format a field in a form once the...
1
by: Tim::.. | last post by:
Hi can someone please tell me why I keep getting the following error when I execute this code! I have checked the database and it seems like everything is set as integer for pageID! Error:...
8
by: Radith | last post by:
Hi All, I have a number guessing game in which users try to guess a random number. Obviously, input is required of type int. BUT, when a user inputs a string the program will result in an...
5
by: blackg | last post by:
Input string not in correct format -------------------------------------------------------------------------------- I am trying to view a picture from a table. I am getting this error Input string...
1
by: John_H | last post by:
Re: ASP.NET 2.0 I would like suggestions or code examples on how to collect a variable length list of input data (item# & item quantity specifically). I thought that I could accomplish this...
8
by: ais523 | last post by:
I use this function that I wrote for inputting strings. It's meant to return a pointer to mallocated memory holding one input string, or 0 on error. (Personally, I prefer to use 0 to NULL when...
0
by: hudhuhandhu | last post by:
have got an error which says Input string was not in a correct format. as follows.. Description: An unhandled exception occurred during the execution of the current web request. Please review the...
27
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
I have a fully-portable C program (or at least I think I do). It works fine on Windows, but malfunctions on Linux. I suspect that there's something I don't know about the standard input stream...
9
by: arnuld | last post by:
Earlier, I have posted a program like this, a month ago IIRC. I have created it again, without looking at the old program. Can I have your opinions on this: 1) I wanted my program to be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.