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’s the use of “GLOBAL.ASAX” file?
Explain server-side scripting and client-side scripting.
Is post back in asp.net?
What happens if an ASP.NET server control with event-handling routines is missing from its definition?
how can create login from create and written conde in asp.net
What is a pixel url?
Explain the various authentication mechanisms in asp.net.
Where session variables are stored?
What are Master Pages in ASP.NET?
What is the difference between typeof() vs gettype()?
How to implement Authentication and Authorization?
What is the use of service provider?
What is postback pixel?
Define tracing.
Explain the differences between managed and unmanaged code?