473,770 Members | 6,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.FormatEx ception: Input string was not in a
correct format.

Source Error:

Line 188: do until rs_user.eof Line
189: 'if (IsDBNull(curre nt_dept.Value) <> true) then
Line 190: if (current_dept <>
rs_user.Fields. Item("departmen t").value)th en
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("departme nt").Value)
Source File: C:\Documents and Settings\amit\W ebSite1\list_us ers.aspx
Line: 190

Stack Trace:

[FormatException : Input string was not in a correct format.]
Microsoft.Visua lBasic.Compiler Services.Conver sions.ParseDoub le(String
Value, NumberFormatInf o NumberFormat) +211
Microsoft.Visua lBasic.Compiler Services.Conver sions.ToDouble( String
Value, NumberFormatInf o NumberFormat) +74[InvalidCastExce ption:
Conversion from string "" to type 'Double' is not valid.]
Microsoft.Visua lBasic.Compiler Services.Conver sions.ToDouble( String
Value, NumberFormatInf o NumberFormat) +218
Microsoft.Visua lBasic.Compiler Services.Operat ors.CompareObje ct2(Object
Left, Object Right, Boolean TextCompare) +3020
Microsoft.Visua lBasic.Compiler Services.Operat ors.Conditional CompareObjectNo tEqual(Object
Left, Object Right, Boolean TextCompare) +25
ASP.list_users_ aspx.__Render__ control1(HtmlTe xtWriter __w, Control
parameterContai ner) in C:\Documents and
Settings\amit\W ebSite1\list_us ers.aspx:190
System.Web.UI.C ontrol.RenderCh ildrenInternal( HtmlTextWriter writer,
ICollection children) +98
System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer writer) +20
System.Web.UI.P age.Render(Html TextWriter writer) +27
System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer,
ControlAdapter adapter) +53
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer,
ControlAdapter adapter) +280
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer) +24
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)
+8878

Thankyou

Nov 19 '05 #1
1 1852
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*******@gmai l.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.FormatEx ception: Input string was not in a
correct format.

Source Error:

Line 188: do until rs_user.eof Line
189: 'if (IsDBNull(curre nt_dept.Value) <> true) then
Line 190: if (current_dept <>
rs_user.Fields. Item("departmen t").value)th en
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("departme nt").Value)
Source File: C:\Documents and Settings\amit\W ebSite1\list_us ers.aspx
Line: 190

Stack Trace:

[FormatException : Input string was not in a correct format.]
Microsoft.Visua lBasic.Compiler Services.Conver sions.ParseDoub le(String
Value, NumberFormatInf o NumberFormat) +211
Microsoft.Visua lBasic.Compiler Services.Conver sions.ToDouble( String
Value, NumberFormatInf o NumberFormat) +74[InvalidCastExce ption:
Conversion from string "" to type 'Double' is not valid.]
Microsoft.Visua lBasic.Compiler Services.Conver sions.ToDouble( String
Value, NumberFormatInf o NumberFormat) +218
Microsoft.Visua lBasic.Compiler Services.Operat ors.CompareObje ct2(Object
Left, Object Right, Boolean TextCompare) +3020
Microsoft.Visua lBasic.Compiler Services.Operat ors.Conditional CompareObjectNo tEqual(Object
Left, Object Right, Boolean TextCompare) +25
ASP.list_users_ aspx.__Render__ control1(HtmlTe xtWriter __w, Control
parameterContai ner) in C:\Documents and
Settings\amit\W ebSite1\list_us ers.aspx:190
System.Web.UI.C ontrol.RenderCh ildrenInternal( HtmlTextWriter writer,
ICollection children) +98
System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer writer) +20
System.Web.UI.P age.Render(Html TextWriter writer) +27
System.Web.UI.C ontrol.RenderCo ntrolInternal(H tmlTextWriter writer,
ControlAdapter adapter) +53
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer,
ControlAdapter adapter) +280
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer) +24
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)
+8878

Thankyou

Nov 19 '05 #2

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

Similar topics

6
9636
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 person has completed it. The format should be "00". For example, if the person puts 1 then it should become 01 and if the person puts 12 in the field then it should stay like that. If the person puts 2004 then it should become 04, and if the...
1
745
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: Input string was not in a correct format. <CODE> Sub DGPages_Update(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) 'Read in the values of the updated row Dim pageID As Integer = e.Item.Cells(1).Text 'Error
8
21018
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 undesired infinite loop. Now, I know a string is not what we're after but in terms of error-handling; How can we prevent users from entering a string? and if we can't do that: How can we make sure if a string is entered, it is realized and discarded.
5
2514
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 not in the correct format. 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...
1
3868
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 using a GridView that has ViewState enabled, an ObjectDataSource to process the submitted list, textboxes for getting new item data and an add button. Does this approach sound feasible or are there better alternatives? My problem is that I don't...
8
2685
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 returning null pointers.) It looks pretty watertight to me, but my version of lint complains about use of deallocated pointers, etc. Is this code completely safe on all input, or have I missed something? /* Header files included in the program...
0
2545
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 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 237: Dim validNow As Integer = 1 Line...
27
3163
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 that's causing the problem. Here's how I wrote the program originally: #include <stdio.h> #include <string.h>
9
2801
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 efficient, so I used reference to vector. 2) anything else you think worth mentioning /* A program that asks the user for input and when user hits EOF will sort the words
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10230
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10058
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10004
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8886
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.