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
SOAP Web Services A SOAP Web Service that supports three operations: add a bibliography entry, delete a bibliography entry and list all bibliography entries. You may design fo

What are the components of WF 4.0? WF having of various components that work together to make desired workflow. The components of WF are given as follows: Workflows and a

Describe the various components in sequence diagrams. Object lifeline: - It shows the lifetime of an object creation and its destruction. If the object is created or des

#question.cookies working with data.

. write a program for displaying the total no of characters, words and sentences in a given file

What is Dynamic Language Runtime (DLR)? DLR is a runtime environment that permits you to integrate dynamic languages with the Common Language Runtime (CLR) by adding a set of s

What is XML Text Reader? The "XmlTextReader" class helps to give fast access to streams of XML data in a forward-only and read-only manner. The XMLTextReader also checks if the

What is Common Type System (CTS)? CTS is the component of CLR by which .NET Framework provides support for multiple languages because it have a type system that is common acros

Question: (a) One problem encountered when designing web applications is that HTTP is a "stateless" protocol. Explain two general approaches to solve the statelessness problem

What is fill factor? The 'fill factor' option describes how full SQL Server will make each index page. When there is no free space to insert a new row on the index page, the SQ