Friday, 9 May 2014

What is the difference between .tostring(), Convert.tostring()?

int i= 0;
MessageBox.Show(i.ToString());
MessageBox.Show(Convert.ToString(i));
We can convert the integer i using i.ToString () or Convert.ToString
The basic difference between them is “Convert” function handles NULLS while
“.ToString()” does not it will throw a NULL reference exception error. So as a good coding
practice using “convert” is always safe.

No comments:

Post a Comment

How to improve applications performance which is hosted in cloud ?

Improving the performance of an application hosted in Microsoft Azure involves a combination of optimizing your application code, leveraging...