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 full form of asp.net?

952


Explain the asp.net mvc request life cycle? : asp.net mvc

937


Which is the parent class of the ASP.NET server control?

1018


State differences between MVC and WebAPI

1071


What is anonymous authentication?

1085


What is preprocessor in .net?

925


How can we identify that the page is post back in asp net?

894


Is viewstate secure?

915


Where is the view state data stored in asp net?

969


Differentiate between globalization and localization.

932


Explain the use of errorprovider control in .net?

905


How do u optimize a query in asp.net?

953


How does session authentication work?

873


Define repository pattern in mvc.net? : asp.net mvc

1000


How to rename a table using sql queries?

1026