Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

asp to asp.net input string error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
amitbadgi@gmail.com - 10 Aug 2005 03:18 GMT
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
Cowboy (Gregory A. Beamer) - MVP - 10 Aug 2005 15:21 GMT
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.

Signature

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

***************************
Think Outside the Box!
***************************

> Welcome back amitbadgi | Logout | Faq
> Knowledge Discovery Keys
[quoted text clipped - 76 lines]
>  
> Thankyou

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.