Parseint in vb.net?

Discussion in 'ASP .Net' started by Garg, Feb 14, 2007.

  1. Garg

    Garg Guest

    Please tell me how do we use parseint function or its equivalent in
    vb.net.
    And also tell me how do we hide and display controls during run-time
    in vb.net? I need to access the rows of a table for rendering them
    during run-time.
    Garg, Feb 14, 2007
    #1
    1. Advertising

  2. On Feb 14, 7:49 am, "Garg" <> wrote:
    > Please tell me how do we use parseint function or its equivalent in
    > vb.net.


    There are two functions:
    Integer.parse(stringWithNumber) which returns an integer but throws an
    exception if the string is not a number.

    The other one, which I recommend, is Integer.tryParse, use it like
    this:
    Dim outNumber as Integer
    If not Integer.tryParse(stringWithNumber, outNumber) Then
    outNumber = defaultValue
    End If
    ----

    If stringWithNumber is not parseable as an Integer outNumber is set to
    0.
    Henrik Stidsen, Feb 14, 2007
    #2
    1. Advertising

  3. Garg

    Garg Guest

    Thanks a lot Henrik!!
    I was kinda stuck there...since am new to vb.net
    Garg, Feb 14, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sam Iam
    Replies:
    6
    Views:
    3,961
    satdmail
    Jul 19, 2006
  2. Knute Johnson

    Interesting Integer.parseInt() problem

    Knute Johnson, Jan 31, 2006, in forum: Java
    Replies:
    4
    Views:
    12,426
    Roedy Green
    Jan 31, 2006
  3. Paul Rubin
    Replies:
    3
    Views:
    692
    jose isaias cabrera
    Feb 1, 2005
  4. Bill Mill
    Replies:
    0
    Views:
    354
    Bill Mill
    Feb 1, 2005
  5. Garg

    Parseint in vb.net?

    Garg, Feb 14, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    561
Loading...

Share This Page