Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3300746
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:41:21+00:00 2026-05-17T20:41:21+00:00

Possible Duplicate: Whats the main difference between int.Parse() and Convert.ToInt32 I would like to

  • 0

Possible Duplicate:
Whats the main difference between int.Parse() and Convert.ToInt32

I would like to know what are PRO and CONS of using Convert.ToInt32 VS int.Parse.

Here an example of syntax I am using:

            int myPageSize = Convert.ToInt32(uxPageSizeUsersSelector.SelectedValue);

            int myPageSize = int.Parse(uxPageSizeUsersSelector.SelectedValue);

I also found out these articles, maybe they can help for a discussion:

  • http://dotnetperls.com/int-parse
  • http://aspdotnethacker.blogspot.com/2010/04/difference-between-int32parsestring.html
  • http://aspdotnethacker.blogspot.com/p/visual-studio-performance-wizard.html
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T20:41:22+00:00Added an answer on May 17, 2026 at 8:41 pm

    Convert.ToInt32 is for dealing with any object that implements IConvertible and can be converted to an int. Also, Convert.ToInt32 returns 0 for null, while int.Parse throws a ArgumentNullException.

    int.Parse is specifically for dealing with strings.

    As it turns out, the string type’s IConvertible implementation merely uses int.Parse in its ToInt32 method.

    So effectively, if you call Convert.ToIn32 on a string, you are calling int.Parse, just with slightly more overhead (a couple more method calls).

    This is true for any conversion from string to some primitive type (they all call Parse). So if you’re dealing with strongly-typed string objects (e.g., you’re parsing a text file), I’d recommend Parse, simply because it’s more direct.

    Converting arbitrary objects (returned to you by some external library, for instance) is the scenario where I’d opt for using the Convert class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Difference between void main and int main? Alright, so I'm using bloodshed
Possible Duplicate: What is the difference between "typename" and "class" template parameters? When defining
Possible Duplicate: What's the difference between NOT EXISTS vs. NOT IN vs. LEFT JOIN
Possible Duplicate: MVC versus WebForms Was curious what the main benefits of going MVC
Possible Duplicate: What’s the “condition” in C interview question? void main() { if(CONDITION) printf(Hello
Possible Duplicate: What Ruby IDE do you prefer? I've generally been doing stuff on
Possible Duplicate: What does map(&:name) mean in Ruby? I was watching a railscast and
Possible Duplicate: What are the obj and bin folders (created by Visual Studio) used
Possible Duplicate: What is the exact problem with multiple inheritance? Why is multiple inheritance
Possible Duplicate: What's wrong with Delphi's “with” I am have a problem debugging code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.