I'm trying convert value passed via text field to decimal and getting an error in doing so. I'm using vb .net trying to process gift certificates using web api. Any suggestions? Dim bal as decimal bal = Convert.ToDecimal(txtField.Text)
I'm trying convert value passed via text field to decimal and getting an error in doing so. I'm using vb .net trying to process gift certificates using web api. Any suggestions?
Dim bal as decimal
bal = Convert.ToDecimal(txtField.Text)
Can you post the exception message your getting? Also are you getting the message when your trying to comiple the code or when your running it?
Jon
If thats the code your using character by character I think you should try the following instead:
Dim bal As Decimal bal = Convert.ToDecimal(txtField.Text) The difference is As rather than as and Decimal rather than decimal .
The difference is As rather than as and Decimal rather than decimal .
I'm using correct case, vs web edition 08 makes all corrections for me
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.FormatException: Input string was not in a correct format.
--Ruslan
VB.NET isn't case sensitive, but Intellisense will set declarations to capitalize