Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET 1.0
|
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
 
Old September 15th, 2004, 02:43 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Default

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>>--
 
Old September 15th, 2004, 03:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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
 
Old September 15th, 2004, 03:39 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Default

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>>--
 
Old September 15th, 2004, 03:56 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Can you use Convert.ToInteger in C#?

 
Old September 15th, 2004, 03:57 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Default

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>>--
 
Old September 15th, 2004, 04:06 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Default

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>>--
 
Old September 15th, 2004, 04:34 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Default

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>>--
 
Old September 16th, 2004, 07:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Now that makes sense, because you probably should have done:

Application["counter"]=((Int32)objRW_G["count_all"])+100;

Brian
 
Old September 16th, 2004, 07:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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.

 
Old September 16th, 2004, 11:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Specified cast is not valid surajb Crystal Reports 0 January 12th, 2007 02:03 PM
Specified cast is not valid. abstar BOOK: ASP.NET Website Programming Problem-Design-Solution 2 March 31st, 2005 03:00 PM
"Specified cast is not valid" help BaBaBooey ASP.NET 1.0 and 1.1 Basics 2 November 23rd, 2004 12:12 PM
Specified cast is not valid TheMole BOOK: ASP.NET Website Programming Problem-Design-Solution 9 November 1st, 2004 05:09 PM





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