Friday 4 November 2016

.ToString() vs Convert.ToString()

.ToString() vs Convert.ToString()


"Convert.ToString(Variable)" handles NULL Values even the varaible value becomes NULL.

"Variable.ToString()" will not handle NULL Values and it throws a NULL reference exception error. 

So as a good practice using Convert function is always safe.









Hope this information  helpful to you. Thank you for taking time to look at my blog. ----- Syed Sadiq Ali.      







No comments: