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
Explain memory-mapped files. Memory-mapped files (MMFs) permit you map the content of a file to the logical address of an application. These files enable the multiple processes

Project Description: I have a website that I have prepared, but I would like someone to make it look nicer. Most of the functionality is there, but I need help with design which

show the dot net topic

What are the different types of joins? 1) INNER JOIN: The Inner join shows matches only when they exist in both the tables.For example, in the SQL below there are two tabl

Give a brief introduction of Windows Azure operating system. The Windows Azure operating system is used for running cloud services on the Windows Azure platform, as it includes

What is a DataReader object? The DataReader object helps in retrieving the data from a database in a forward-only, read-only mode. The base class for all the DataReader objects

Explain the concept of destructor? A destructor is a special method for a class and is requested automatically when an object is finally destroyed. The name of the destructor i

Who is a stakeholder? The stakeholder is anyone who has something to gain or lose as a result of the completion or failure of the project or phase. The stakeholder is not on

Question: (a) Give four benefits of ASP.NET Web Controls. (b) List and explain any five properties of the ValidationSummary control. (c) Multiple Web Form controls ca

UDP Based, Data Transfer Server/ Client in .NET C# Project Description: We require the Network Level Functionalities (NLFs) of a Server/ Client for transferring data among tw