C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Differences Between Convert.ToInt and Int.Parse


Posted Date: 19 Jun 2008    Resource Type: Articles    Category: .NET Framework
Author: Gaurav AgrawalMember Level: Silver    
Rating: Points: 5



Convert.ToInt

This method can handle a null value. For Example,


String value = null;
response.write(convert.ToInt32(value));


This statement will print 0 on the screen because this method converts null values to 0.

Int.Parse

This method can not handle null values.


String value = null;
response.write(int.parse(value));


This statement will show an error message on the screen. So we should always give preference to Convert.toInt over int.Parse method.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Int.Parse vs Conver.ToInt  .  Difference between Convert.ToInt and Int.Parse  .  Convert.ToInt vs Int.Parse  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Difference between using directive and Using Statement in .NET
Previous Resource: View State Chunking in ASP.NET
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use