Difference Between .ToString() and Convert.ToString()?
Difference Between .ToString() and Convert.ToString() methods in C#?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Salman BegRank #284 · 8.8K reputationPosted Nov 18, 2016, 1:02 AM EST
MayankRank #4,018 · 371 reputationPosted Nov 18, 2016, 1:05 AM EST
Convert.ToString()handlesnull, whileToString()doesn't.If u think it resolve your issue please marked as answer.
Lokesh KumarRank #4,352 · 349 reputationPosted Nov 18, 2016, 7:15 PM EST
MessageBox.Show(result .ToString());
MessageBox.Show(Convert.ToString(result ));
MessageBox.Show(result.ToString()); //throw an Error
Milan Prajapati107 reputationPosted Nov 19, 2016, 2:12 AM EST
The Convert.ToString(value) handles NULL values and it does not throw any exception even if value is null. On the other hand,
The value.ToString() does not handle NULL values it will throw NULL reference exception.