473,804 Members | 4,408 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trying to find source of error

I'm new to .NET and I have a error that is coming up but it's not telling me
where the error is coming from (no file). Is that because I'm doing
something wrong...or is it a type of error that has nothing to do with my
code? P.S. I'm debugging someone else's code. Here's what the screen looks
like when I load the page:

*************** *************** *************** ******
Input String was not in a correct format

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

Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:

[FormatException : Input string was not in a correct format.]
System.Number.P arseInt32(Strin g s, NumberStyles style, NumberFormatInf o
info) +0
System.Int32.Pa rse(String s) +38
customer.OrderD etail.loadDetai l()
customer.OrderD etail.Page_Load (Object sender, EventArgs e)
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +731
*************** *************** *************** ******

Any help is greatly appreciated.

-bruce duncan

Nov 18 '05 #1
3 1366
Bruce -
You probably have a page called OrderDetail.asp x. There's a matching
file, either OrderDetail.asp x.vb or OrderDetail.asp x.cs. That page has
a function called loadDetail that is reading an OrderDetail ID number
from something, possibly the Query String. It's expecting the value to
be an integer, but it's getting something it can't convert to an
integer.

I'd set a breakpoint on the loadDetail function and run the application
in Debug mode, then step through the loadDetail function when the
breakpoint hits and see where it blows up.
- Jon
http://weblogs.asp.net/jgalloway

Nov 18 '05 #2
>
I'd set a breakpoint on the loadDetail function and run the application
in Debug mode, then step through the loadDetail function when the
breakpoint hits and see where it blows up.
- Jon
http://weblogs.asp.net/jgalloway


Jon,
Thanks for the advice. Since I'm developing this project on a PC other than
the web server, I can't run it in debug mode (or at least I can't get it to
work). So, I've been trying to narrow down the possible bugs...here's my
function...any thoughts?

private void loadDetail()
{
string orderdtlSQL = "select orderqty, ium, partnum, linedesc, unitprice
from pub.orderdtl where company='OGI' and ordernum = '" + ordernum + "' and
custnum = " + custnum;
DataTable table = d.getDataTable( "vntg",orderdtl SQL);
table.Columns.A dd("extprice") ;
int ShipQty = 0;
foreach(DataRow row in table.Rows)
{
// extprice = qty * unitprice
row["extprice"] = Single.Parse(ro w["orderqty"].ToString()) *
Single.Parse(ro w["unitprice"].ToString());
// accumulate qty
ShipQty += Int32.Parse(row["orderqty"].ToString());
}
this.lblQtyTota l.Text = ShipQty.ToStrin g();
this.rptOrderDe tail.DataSource = table;
this.rptOrderDe tail.DataBind() ;

}

Thanks,
bruce

Nov 18 '05 #3
Bruce -
It looks from the stack trace that the error is on this line:
ShipQty += Int32.Parse(row["orderqty"].ToString());

You should check your data to see if you have non-numeric data in your
orderqty field. From your code, this SQL statement would probably find
it:
select * from pub.orderdtl where company='OGI' and isnumeric(order qty)
= 0;

Additionally, you could wrap the line that's throwing the exception
with a try / catch:

try
{
ShipQty += Int32.Parse(row["orderqty"].ToString());
}
catch (Exception e)
{
Context.Trace.W arn("Exception" , "Non-numeric ORDERQTY", e);
}

The Context.Trace.W arn statement writes the error info out to the
ASP.NET trace. If you're not familiar with that, this article is a good
place to start:
http://msdn.microsoft.com/library/de...sp01252001.asp
- Jon
http://weblogs.asp.net/jgalloway

Nov 18 '05 #4

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

Similar topics

2
8811
by: David Shorthouse | last post by:
I am trying to create a guest book using ASP Server Application Error The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server administrator for assistance. That is the error I get back from the browser This is what I get from my server????
6
2305
by: Frank Wilson | last post by:
Tom, It sounds to me like ASP, not ASP.NET is handling the request for WebForm1.aspx. This is most likely an IIS config issue that may have been caused by order of installation or reinstallation, or possibly even something that happened in IIS before .NET was installed. Here is a way to prove or disprove my theory:
12
2932
by: Phil Certain | last post by:
Hi, I'm trying to do something very simple...or at least it should be. I have created a host page (gen.aspx) and a very simple user control (us.ascx). The corresponding code-behind files are gen.aspx.vb and uc.ascx.vb. With simple html or self contained vb in the user control, everything is fine and dandy. So the next stage is to pass back a simple variable from the user control to the host page. I used VS.NEt to create the files.
2
2621
by: msnews.microsoft.com | last post by:
I am currently trying to follow the Que Publishing exam guide to the Microsoft Exam 70-320. I followed the guide to a tee, but when I try to add a web reference to my server side soap extension it gives me the following error:- An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message:...
1
2687
by: Will Parsons | last post by:
I am trying to get started with using Docbook/xml using free tools and am stymied in generating printable documentation from even the simplest source. I have attempted to generate a PDF using xmlto (which I guess is a shell interface to xsltproc) for the docbook source on a variety of platforms: Debian GNU/Linux stable, Gentoo GNU/Linux, FreeBSD, and Cygwin. In no case have I been successful, and the error messages are certainly not...
0
2493
by: Henrik Stidsen | last post by:
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC2017: could not find library 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\0f509e6d\d726281b\App_Web_ucwtgyt9.dll' Source Error:
0
11707
by: cwho.work | last post by:
Hi! We are using apache ibatis with our MySQL 5.0 database (using innodb tables), in our web application running on Tomcat 5. Recently we started getting a number of errors relating to java.sql.SQLException: Deadlock found when trying to get lock; Try restarting transaction message from server: "Lock wait timeout exceeded; try restarting transaction"; We get such errors generally on inserts or updates while applying a
2
9185
by: JT | last post by:
Okay, I've seen about 4 years' worth of posts about this with no viable solutions. I've spent 9 hours today trying to fix this. It works BEAUTIFULLY on my local IIS installation, but when I publish to my web host and try to add a web reference I get the following: Server Error in '/' Application. -------------------------------------------------------------------------------- Parser Error Description: An error occurred during the...
10
6779
richardhodge
by: richardhodge | last post by:
I am a VB6 database programmer and have run into a small problem. The company I work for primarily uses Microsoft Access 2000 for the database that is the back end for our software. Well the functionality that I am currently working on creates a table in one database and then links it into the primary database that is used by the program to store and retrieve data from. Here's the problem. I can create the table fine but when I go to link the...
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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,...
1
10320
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
10077
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
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
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2991
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.