A 32-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null.
Type Reason ArgumentNullException value is a null reference. FormatException value cannot be converted to a numeric value. OverflowException The numeric value of value is greater than int.MaxValue or less than int.MinValue.
Using the Convert.ToInt32(string) method is equivalent to passing value to the int.Parse(string) method. value is interpreted by using the formatting conventions of the current thread culture.
If you prefer not to handle an exception if the conversion fails, you can call the int.TryParse(string, Int32@) method instead. It returns a bool value that indicates whether the conversion succeeded or failed.