Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between int.Parse() and
Convert.toInt32().

Answer Posted / jyoti magdum

Both(Convert.ToInt32 and int.Parse) will return the same
result in
most of the cases.

string strCount="32";
int count1 = Convert.ToInt32(strCount);
int count2 = int.Parse(strCount);

If you print the result it will be same ie 32.

If suppose the string is the null (see the example below),
Convert.ToInt32 will throw ArgumentNullException error.

and the int.Parse will throw ArgumentNullException error.

string strCount=null;
int count1 = Convert.ToInt32(strCount);//Error
int count2 = int.Parse(strCount); // Error

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of serialization?

907


What are the three types of predicates?

800


What is difference between constants and readonly in c#?

978


Where test director stores its data ? Database ,Local file etc...? I need to read this data from Visual Studio 2005 c# client. Regards

1812


What is file extension of webservices?

988


Which .gang of four. Design pattern is shown below?

862


How do you escape c#?

844


How garbage collection deals with circular references.

810


What is string literal in c#?

987


What is a collection class in c#?

847


Explain About Global.asax

915


What is COM Interoperability?

909


What is connection pooling in ado.net?

890


What is distribute by in hive?

988


Define boxing and unboxing in c#?

810