What is the difference between Convert.toString and .toString() method ?
Purushottam Rathore
What is the difference between Convert.toString and. ToString() method ?
Convert.toString uses convert class method, which contains different static method to convert one primitive type to another primitive type.
Hi,
Just to give an understanding of what the above question means seethe below code. int i =0; MessageBox.Show(i.ToString()); MessageBox.Show(Convert.ToString(i));
Just to give an understanding of what the above question means seethe below code.
We can convert the integer "i" using "i.ToString()" or "Convert.ToString" so what’s the difference. The basic difference between them is "Convert" function handles NULLS while "i.ToString()" does not it will throw a NULL reference exception error. So as good coding practice using "convert" is always safe.