What is the difference between Convert.toString and .toString() method
To know the difference between Convert.toString and .toString() see the below code :
int i =0;
MessageBox.Show(i.ToString());
MessageBox.Show(Convert.ToString(i));
We can change the integer "i" using "i.ToString()" or "Convert.ToString" so what is the difference.
The fundamental difference b/w them is "Convert" function handles NULLS while "i.ToString()" does not.
It will provide a NULL reference exception error. So as good coding practice using "convert" is always secure.