Skip to main content

Posts

Showing posts from November, 2010

Difference between int.Parse and Convert.ToInt32

I know this post sound basic to most of people but still lots of people does not know this. So I decided to post a blog post for this. Both int.Parse and Convert.ToInt32 are used to convert string into the integer but Only difference between them is to Convert.ToInt32 handle null and returns ‘0’ as output and int.parse is not going to handle NULL and will give a Argument Null Exception. Here is the example for that both are almost same except handling null.
string convertToInt = "12";
string nullString = null;
string maxValue = "32222222222222222222222222222222222";
string formatException = "12.32";

int parseResult;

// It will perfectly convert interger
parseResult= int.Parse(convertToInt);

// It will raise Argument Null Exception
parseResult= int.Parse(nullString);

//It willl raise Over Flow Exception
parseResult= int.Parse(maxValue);

//It will rai…

Microsoft Community Techdays in Ahmedabad on 11th December

Microsoft Community Techdays is a great event organized by Microsoft for Every Quarter. Its going to be there on 11th December in Ahmedabad. I want to be there hope I could as my schedule is so start but you guys can not forgot to register at this event. It’s totally free and It’s great place to meet lots of interesting guys like Pinal Dave,Jacob Sebastian etc.Here are the schedule for Ahmedabad.10:15am - 10:30am
Welcome - Pinal Dave10:30am - 11:15am
SQL Tips and Tricks for .NET Developers by Jacob Sebastian11:15am - 11:30am
Tea Break11:30am - 12:15pm
Best Database Practice for SharePoint Server by Pinal Dave12:15pm - 01:00pm
Self Service Business Intelligence by Rehab01:00pm - 02:00pm
Lunch02:00pm - 02:45pm
Managing your future, Managing your time by Vinod Kumar02:45pm - 03:30pm
Windows Azure News and Introducing Storage Services by Mahesh Devjibhai Dhola03:30pm - 03:45pm
Tea Break03:45pm - 04:30pm
Improve Silverlight application with Threads and …