Click here to Skip to main content
15,903,175 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How to solve this error "Can't convert String into integer"?
Posted
Updated 6-Apr-14 9:08am
v2
Comments
[no name] 6-Apr-14 11:13am    
Well the obvious thing to try would be to supply a string that could be converted to an integer.

1 solution

cause of this error is you are trying to convert characters.
for example
VB
Convert.Int32("12a") 'error because 'a' is not an integer

VB
Convert.Int32("12") 'successful 

you can use Integer.TryParse
VB
Dim amt as Integer 
Integer.TryParse("12a", amt)

Happy Coding!
:)
 
Share this answer
 
v2
Comments
manisha.patel.wow 6-Apr-14 11:39am    
thanks to tell me the answer
Aarti Meswania 6-Apr-14 11:56am    
Welcome!
Glad to help you! :)

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



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