473,322 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

System.Convert.ToInt32 vs Int32.Parse

Hi
Can anyone offer a comparison of System.Convert.ToInt32 vs Int32.Parse

Thanks
Mar 27 '06 #1
1 4905
The only difference I'm aware of is to do with nulls.

Convert.ToInt32 will return a zero and int32.Parse will throw an
ArgumentNullException

I've found the timings to be pretty much identical at runtime

Mar 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Daniel Billingsley | last post by:
Is there any significant difference between int variable1 = (int) variable2; and int variable1 = Convert.ToInt32(variable2); It seems like the extra typing and granularity of .ToInt32 vs....
3
by: Convert TextBox.Text to Int32 Problem | last post by:
Need a little help here. I saw some related posts, so here goes... I have some textboxes which are designed for the user to enter a integer value. In "old school C" we just used the atoi function...
6
by: Ant | last post by:
Hi, I'm trying to find out the benefits of one type of conversion method over another. When would it be best to use casting over Converting e.g. (int)stringValue as opposed to ...
2
by: John Salerno | last post by:
Is there any difference (performance-wise or otherwise) between the Parse method and the methods of the Convert class when dealing with a string? Int32.Parse(string); or ...
1
by: Hifni Shahzard | last post by:
Hi, I got a stored procedure, where it returns a value. But if I execute it. It gives an error as "Invalid cast from System.Int32 to System.Byte.". To make clear how do I execute this, below I'm...
3
by: clickon | last post by:
I have an integer value in a textbox, i want to use the value to perform a mathematical calculation, however i can only access this value as a string and i can't cast a string to an int. How do i...
3
by: psycho | last post by:
what is the difference between the two forms of converting to integer from string string strVal = "10"; Convert.ToInt32(strVal); Int32.Parse(strVal); which method is more efficient in...
6
by: Ken Fine | last post by:
This is a basic question. What is the difference between casting and using the Convert.ToXXX methods, from the standpoint of the compiler, in terms of performance, and in other ways? e.g. ...
6
by: Tony | last post by:
Hello! It seems to me that both Int32.Parse(..) and Convert.ToInt32(...) static methods works in exactly the same way. Both can throw an exeption. So is it any different at all between these...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.