 |
| 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
|
|
|
|

December 13th, 2006, 11:05 AM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
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
|
|

December 13th, 2006, 11:07 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2006
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
it gives the number only,
ie, for eg: 12
|
|

December 13th, 2006, 11:18 AM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
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
|
|

December 13th, 2006, 11:27 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2006
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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)
|
|

December 13th, 2006, 12:27 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
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
|
|

December 13th, 2006, 01:21 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2006
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

December 13th, 2006, 02:59 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
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
|
|

December 14th, 2006, 02:41 AM
|
|
Friend of Wrox
|
|
Join Date: May 2005
Posts: 227
Thanks: 1
Thanked 7 Times in 7 Posts
|
|
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.
|
|

December 14th, 2006, 08:34 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2006
Posts: 107
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks to all for all ur valuable advises
|
|

December 14th, 2006, 09:26 AM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
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
|
|
 |