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
Require Guys in Gaming Tracks Company for a mobile game developing Project Description: I want a team of game developers for life-time as mobile dev team in my company. So, i

Project Description: We are seeking experienced .NET developers (possibly certified) to work with us on several future projects. You will have to pass a simple test to be consid

Read an Array and perform Sorting - C# program Can any one assist me in performing sorting of an array.

We need customization of features in Silverlight component plugin I have bought a Silverlight charting component for stock markets. Source code is available in C# besides is wel

ASP Programmer I need a fixing all W3c validation errors and it is a ASP website. Have any queries please send a message and I will provide more information on project. De

What is Windows Workflow Foundation (WF)? Windows Workflow Foundation (WF) is a technology that was first introduced in .NET Framework 3.0. WF having of a programming model, a

What are the problems that can occur if you do not implement locking properly in SQL SERVER? The problems that occur if you do not implement locking properly in SQL SERVER is a

Can you define what inheritance is and an example of when you might use it? The process of deriving a new class from an existing class is known as Inheritance. The old class is

What is the relationship between a class and an object? A class acts as a blue-print that explains the properties, states, and behaviors that are common to a number of objects.