Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

oops it's not working

sorry robby for that

i write the code like that

int myAsc = Convert.ToInt32(A);

MessageBox.Show(myAsc);

there error called

The name 'A' does not exist in the class or namespace 'ConsoleApplication1.Class1'

well i tried to put it like that

 

int myAsc = Convert.ToInt32("A");

here the error was

Input string was not in a correct format.

so do u have any advice for me

  • *Experts*
Posted

You need to enclose the A in single quote marks to pass it as

a Char type instead of as a String.

 

int myAsc = Convert.ToInt32('A');

 

In VB.NET, this is accomplished with a trailing c after the quote marks:

Dim myInt As Integer = Convert.ToInt32("A"c)

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...