Difference between convert.tostring and .tostring() method, DOT NET Programming

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.

Posted Date: 9/21/2012 7:04:02 AM | Location : United States







Related Discussions:- Difference between convert.tostring and .tostring() method, Assignment Help, Ask Question on Difference between convert.tostring and .tostring() method, Get Answer, Expert's Help, Difference between convert.tostring and .tostring() method Discussions

Write discussion on Difference between convert.tostring and .tostring() method
Your posts are moderated
Related Questions
Difference between Panel and Group Box classes? Panel & Group box both can used as container for other controls like radio buttons & check box. the difference in panel & group

I want Windows 8.1 Metro style app development Project Description: I want Windows 8 & 8.1 metro style app development - Media Player application Skills required are C# Pr

What are advantages of using UML? As the name suggests the UNIFIED MODELING LANGUAGE, The Modeling has been around for years, not only in the software field but also in other t

I want to prepare one web based application which have student registration and according to semester and every time it will change as per semester change according, now student ge

What is the difference between Class and structure's? The main differences between them are as follows:- 1) The Structure is value types while classes are referen

What is Cache Callback? The Cache object is dependent on its dependencies for example time based, file based, etc...The Cache items remove the object when cache dependencies ch

Information Retrieval from Multi-Agent System with Data Mining in Cloud Computing Project Description: I have planned one research model on "Information Retrieval through Mul


Which template must you provide, in order to display data in a Repeater control? ItemTemplate.To display data in the ItemTemplate, declare one or more Web server controls and s

Project Description: This is an online customization printing system they use for multiple organizations to allow customizing  and access of materials they allocate to drive iss