Very interesting thing in conversion is
Input string, here some examples to understand convertion..
1.
int numVal = Int32.Parse("-105");
Console.WriteLine(numVal);
2.
int j;
bool result = Int32.TryParse("-105", out j);
if (true == result)
Console.WriteLine(j);
else
Console.WriteLine("String could not be parsed.");
3.
try
{
int m = Int32.Parse("abc");
}
catch (FormatException e)
{
Console.WriteLine(e.Message);
}
4.
string inputString = "abc";
int numValue;
bool parsed = Int32.TryParse(inputString, out numValue);
if (!parsed)
Console.WriteLine("Int32.TryParse could not parse '{0}' to an int.\n", inputString);
From above example you come to know that input string should be in correct format..