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’s the use of “GLOBAL.ASAX” file?

1094


Explain server-side scripting and client-side scripting.

926


Is post back in asp.net?

958


What happens if an ASP.NET server control with event-handling routines is missing from its definition?

1117


how can create login from create and written conde in asp.net

2437


What is a pixel url?

941


Explain the various authentication mechanisms in asp.net.

990


Where session variables are stored?

984


What are Master Pages in ASP.NET?

1070


What is the difference between typeof() vs gettype()?

1108


How to implement Authentication and Authorization?

1061


What is the use of service provider?

1031


What is postback pixel?

1007


Define tracing.

1117


Explain the differences between managed and unmanaged code?

1046