Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 13th, 2006, 11:05 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Check the value of dgi.Cells(2).Text, e.g. write the value out to the screen see what that value is.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old December 13th, 2006, 11:07 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it gives the number only,
ie, for eg: 12

 
Old December 13th, 2006, 11:18 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Hmmm not sure. How many times does your loop execute? It could be that there is an instance where you are passing a null string into decimal.parse or convert.todecimal and that is what is causing the errror.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old December 13th, 2006, 11:27 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it just go through the datagrid items
but however, how can the unitprice be passed as zero?

but the dgi.cell(2).text returns number only(not without a $ sign)

 
Old December 13th, 2006, 12:27 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I dont understand what you are asking.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old December 13th, 2006, 01:21 PM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
Default

what i meant was how can there be chance of passing a null string? as the unit prices are all set
can you please help me to proceed from this error

 
Old December 13th, 2006, 02:59 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You are making the assumption that your program logic (in regards to looping through the datagrid) is correct but now you are getting an error, you need to go at the problem as though your logic is incorrect and figure out why.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old December 14th, 2006, 02:41 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 227
Thanks: 1
Thanked 7 Times in 7 Posts
Default

sarah lee:
In addition to the above replies, one issue I noticed is your call to the FillCartFromDB(). In your source you have this routine declared as a FUNCTION, which by definition MUST return an answer, as in: MyCart=FillCartFromDB()
According to your source code listed it would be easier to change your FUNCTION statement to a SUBROUTINE statement.

Hope this helps.
 
Old December 14th, 2006, 08:34 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks to all for all ur valuable advises

 
Old December 14th, 2006, 09:26 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Expanding further on peace95s reply, in C# you CANNOT get away with declaring a function and not returning something as the compiler will spit out an error:

"Not all code paths return a value"


-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature





Similar Threads
Thread Thread Starter Forum Replies Last Post
infinite loop smilesmita Pro PHP 1 December 21st, 2007 10:44 AM
infinite recursion bangbangbogi XSLT 3 May 4th, 2006 05:54 AM
problem getting out of infinite loop and incremtin method VB How-To 0 April 28th, 2006 11:45 PM
How to Write a Infinite Loop Detection jtdang77 Classic ASP Professional 1 October 15th, 2003 03:44 AM
Infinite Loop Detection jtdang77 Classic ASP Basics 0 October 14th, 2003 05:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.