Difference between .ToString() and Convert.ToString()

The basic difference between them is “Convert.ToString(variable)” handles NULL values even if variable value become null but “variable.ToString()” will not handle NULL values it will throw a NULL reference exception error. So as a good coding practice using “convert” is always safe.

Example

Convert.ToString():

  1. string str=null;   
  2. Console.WriteLine(Convert.ToString(str));   
Above line will run successfuly,without throwung any error.

.ToString():
  1. string str=null;  
  2. Console.WriteLine(str.ToString());  
Above line will throw "NullReferenceException".