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
How can you raise custom errors from stored procedure? The RAISERROR statements are  used to produce an ad hoc error message or to retrieve acustom message which is stored in t

What is XML? Extensible markup language (XML) is all about describing the data. Below is a XML which describes an invoice data. Shoes   12 10

How can you increase SQL performance? 1)Keep your indexes as narrow as possible. This reduces the size of the index and decrease the number of reads needed to read the index.

If one of your validations is complicated and does not fit in any validators, what you do? The best way is to go for CustomValidators. The sample code for a custom validator

concept of strong names Strong name is similar to GUID(It is supposed to be unique in space and time) in the COM components.Strong Name is only needed when we need to deploy as

Project Description: College erp Erp key features: Panacea ERP Online Suite is server based college based management software. Gives Password facility for different use

What is the use of the CommandBuilder class? The CommandBuilder class is used to automatically update a database according to the changes made in a DataSet. This class autom

I am concerned to doing like this project, i have 5 years of experience in .net skill in engineering and computer related positions with devotement section, I am now a Senior Softw

Wowza expert required Project Description: Seeking wowza expert to teach our webmaster. To provide: How configure wowza to live transcoder. How allow add live transc

Auto stock market robot Project Description: A total solution for the Robot trading on Nse , currency, Mcx, ncdex,using formulas or using buy sell signals . The solution s