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...

How to convert a string into an Integer in ASP.net?

Answer Posted / suresh

int.Parse parses the input (casts in a sense) to an integer
value however it will throw an exception if it cant do it if
the data provided is not numeric. you should use TryParse in
.NET 2.0 to see if it can parse it.

int a = Int.Parse("int");



Convert.ToInt32() converts the string data to a proper true
int32 value, and throws an exception if it can't convert the
value.


int a = Convert.Int32("String");

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is server transfer?

893


What are the different types of proxy patterns?

1149


What is masterpage?

944


what are the events raised in asp.net page life cycle?in which stage view state can be loaded?

989


Is viewstate enabled by default?

966


How to deploy/publish webservices?How many ways?Plz explain me

2278


How do you initiate validation on the server manually? What are two situations when you might you want to do that?

1826


I have created a configuration setting in my web.config and have kept it at the root level. How do I prevent it from being overridden by another web.config that appears lower in the hierarchy?

994


How can we register exception filter from the action?

1077


Explain server control extensibility with reference to asp.net 2.0 ?

988


Which platform does Microsoft .NET use for exchanging data between applications?

1034


What do you mean by serialize?

969


Suppose you want an asp.net function (client side) executed on the mouseover event of a button. Where do you add an event handler?

1026


What is viewstate parameter?

935


What is the basic difference between asp and asp.net?

1018