 |
BOOK: Beginning ASP.NET 1.0  | This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 1.0 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
|
|
|
|
|

September 15th, 2004, 02:43 PM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
|
|
is there any way to this RowCollection to convert the containing value to any value like int i must mentioned that the culmn collation or DataType is BigInt
but why this error raise and i think we must have any mechanism to manipulation the collections contains is it correct or not.
Thanks In Advance.
YoOrD.
Beauty Is not on the face
Beauty is on the heart
--<<Ghibran Khalil>>--
|
|

September 15th, 2004, 03:29 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
If it's an invalidcastexception, I believe it must be either NULL (DbNull in .NET) or a string value (and not "1", but "x" or some other equivalent). Could also be a number way beyond the capabilties of the int field...
But it has to be something like that, I would think. Could be wrong.
Brian
|
|

September 15th, 2004, 03:39 PM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Thanks For your replies
but i can dispaly and it is not Null the value of the culmn but i cant increment it when i assign the value to Application Object and i cant send it to client Browser and display it and i think it is cant be empty or null value or problem.
Quote:
quote:Originally posted by bmains
Hey,
If it's an invalidcastexception, I believe it must be either NULL (DbNull in .NET) or a string value (and not "1", but "x" or some other equivalent). Could also be a number way beyond the capabilties of the int field...
But it has to be something like that, I would think. Could be wrong.
Brian
|
Beauty Is not on the face
Beauty is on the heart
--<<Ghibran Khalil>>--
|
|

September 15th, 2004, 03:56 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Can you use Convert.ToInteger in C#?
|
|

September 15th, 2004, 03:57 PM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Thanks for replies but how i can use it please give me a syntax about how to use this function.
Quote:
quote:Originally posted by stu9820
Can you use Convert.ToInteger in C#?
|
Beauty Is not on the face
Beauty is on the heart
--<<Ghibran Khalil>>--
|
|

September 15th, 2004, 04:06 PM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
|
|
oooooooohhhhh more Thanks to you i do it and it seems to work correct
thanks and more thanks to you and others.
but the question the i have why the type cast dont work in this way.
and i think is same as casting that what we cast the type.
and other thing that remains is that if it is raise problem for my DB when i insert it into DB.
i must mentioned that i am using this code to it.
Code:
Application["counter"]=Convert.ToInt32(objRW_G["count_all"])+1;
Thanks in Advance.
YoOrD.
Beauty Is not on the face
Beauty is on the heart
--<<Ghibran Khalil>>--
|
|

September 15th, 2004, 04:34 PM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Other problem is that how i can update the culmn of row in data source.
Beauty Is not on the face
Beauty is on the heart
--<<Ghibran Khalil>>--
|
|

September 16th, 2004, 07:11 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
Now that makes sense, because you probably should have done:
Application["counter"]=((Int32)objRW_G["count_all"])+100;
Brian
|
|

September 16th, 2004, 07:27 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
That's why I asked him to remove the +100 earlier...
Convert.ToInteger converts to a .Net type instead of a C# type if I read correctly.
|
|

September 16th, 2004, 11:19 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
Well now that I see that, that probably does make sense, because the old statement should have appeared as:
Application["counter"]=((Int32)objRW_G["count_all"])+1;
Thanks,
Brian
|
|
 |