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
What is full form of asp.net?
Explain the asp.net mvc request life cycle? : asp.net mvc
Which is the parent class of the ASP.NET server control?
State differences between MVC and WebAPI
What is anonymous authentication?
What is preprocessor in .net?
How can we identify that the page is post back in asp net?
Is viewstate secure?
Where is the view state data stored in asp net?
Differentiate between globalization and localization.
Explain the use of errorprovider control in .net?
How do u optimize a query in asp.net?
How does session authentication work?
Define repository pattern in mvc.net? : asp.net mvc
How to rename a table using sql queries?