Click here to Skip to main content
14,739,239 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Why the error is giving COnvertion of string to integer is not right formate in give ling below ?

Dim result As Integer = Integer.Parse(inpHide.Value.ToString())

here inpHide is a Input hidden control
Updated 21-Apr-12 0:44am
Richard MacCutchan 21-Apr-12 5:37am
What is the value of inpHide.Value.ToString()?
Janardan Pandey 21-Apr-12 5:59am
the value is string received from input hidden control and want to convert in integer
Richard MacCutchan 21-Apr-12 13:41pm
No, string is its type, what is the value returned in the string? Judging by the problem you report it is not a valid number.

The best solution to find out and get rid of that error is to watch inpHide.Value, try to debug your application.

Use methods like[^] Integer.TryParse. These ensure that a value is converted to an integer only if it is an integer type.
VJ Reddy 23-Apr-12 19:48pm
Good answer. 5!
Abhinav S 23-Apr-12 23:15pm
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900