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
How many types of triggers are there in update panel?
What is mvc in angular?
What is http response header?
Difference between web user control and web custom control?
Explain the differences between clr & cts?
What is the difference between asp.net mvc and asp.net webforms? : asp.net mvc
How we implement web farm and web garden concept in asp.net?
Describe Segmentation With Paging?
In order to get assembly info which namespace we should import?
Differences between “dataset” and “datareader”.
What is a web api? Which protocol is used in a web api?
How many web config files can be created for an application?
What is the difference between mvc (model-view-controller) and mvp (model-view-presenter)? : asp.net mvc
How do you implement sql caching in asp.net?
How does session id work?