PC Review


Reply
Thread Tools Rate Thread

int.ToString() does not exist. Why?

 
 
axkixx@gmail.com
Guest
Posts: n/a
 
      12th May 2006
For whatever reason, I keep getting error of int.ToString() not
existing. Why not?
Has anyone encountered this problem before?

 
Reply With Quote
 
 
 
 
Michael Nemtsev
Guest
Posts: n/a
 
      12th May 2006
Hello (E-Mail Removed),

Any code sample?

> For whatever reason, I keep getting error of int.ToString() not
> existing. Why not?
> Has anyone encountered this problem before?


---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      12th May 2006
ToString() is a non-static method, and so you need an object reference (an
instance), you can't call the method on the type itself.


So "int.ToString()" won't work, while

int i = 10;
i.ToString(); will work.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"(E-Mail Removed)" wrote:

> For whatever reason, I keep getting error of int.ToString() not
> existing. Why not?
> Has anyone encountered this problem before?
>
>

 
Reply With Quote
 
axkixx@gmail.com
Guest
Posts: n/a
 
      12th May 2006
Sorry. The title of the post could be miesleading, but that's what I
did exactly.

int nStartRow = (currentPage * dgTest.PageSize) + 1;
int nEndRow = nStartRow + dgTest.PageSize - 1;

Both nStartRow and nEndRow spit out value correctly as int data type,
but as soon as adding .ToString() method to each, I get the error
saying "nStartRow.ToString() does not exist". or "nStartRow.ToString()
does not exist".
When I view in "Watch" panel in VS.Net.

On error message on the brpwser tells me :
"Exception Details: Exception of type System.Web.HttpUnhandledException
was thrown.

Exception Details: Exception of type System.Web.HttpUnhandledException
was thrown.
Object reference not set to an instance of an object."

 
Reply With Quote
 
Chris Dunaway
Guest
Posts: n/a
 
      12th May 2006
(E-Mail Removed) wrote:
> int nStartRow = (currentPage * dgTest.PageSize) + 1;
> int nEndRow = nStartRow + dgTest.PageSize - 1;
>
> Both nStartRow and nEndRow spit out value correctly as int data type,
> but as soon as adding .ToString() method to each, I get the error
> saying "nStartRow.ToString() does not exist". or "nStartRow.ToString()
> does not exist".


Show us some more code. Where are you adding the ToString()? We need
more information to help you.

 
Reply With Quote
 
Paul Brower
Guest
Posts: n/a
 
      12th May 2006
Try:

Int32 i = 12345 ;
string x = Convert.ToString(i) ;

 
Reply With Quote
 
axkixx@gmail.com
Guest
Posts: n/a
 
      12th May 2006
My bad, guys. Although it showed "nStartRow.ToString() does not exist"
in Watch window, the problem was somewhere else.

 
Reply With Quote
 
Stuart Irving
Guest
Posts: n/a
 
      15th May 2006
It isn't static, you will need an instance

int myInt = 0;
Console.Write(myInt.ToString());

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> For whatever reason, I keep getting error of int.ToString() not
> existing. Why not?
> Has anyone encountered this problem before?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Defrag does not work - chkdsk does not work Ville Windows XP Help 1 1st Jul 2004 09:34 PM
msn messenger does not work now but can be accsessed from another pc useing my address and password why does it not work on our pc =?Utf-8?B?a2F5?= Windows XP General 1 29th Mar 2004 10:26 AM
Screensaver Does Not Come On or Does not Work dave Windows XP General 1 19th Feb 2004 07:28 AM
How to delete file being used. Restart does not help, safe mode does not help. AS Windows XP Help 1 4th Dec 2003 08:03 PM
Q: "Specified File Does Not Exist Error" Does Not Make sense..... Nicholas Windows XP Accessibility 1 12th Nov 2003 09:37 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:48 PM.