Cast from string " " to type 'Double' is not valid...........Trying to convert a string to a boolean value
Posted on 2004-09-08
I am reading a flat text file with a field that has a blank. I need to covert the string to a boolean value.
Here is the error message
An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll
Additional information: Cast from string " " to type 'Double' is not valid.
Here is the code
Dim tmip As String
tmip = Mid(strLine, 152, 1)
If tmip = 0 Or "" Then
tmip = False
tmip = True
The actual value when you look at the variable is a ""
Any help is greatly appreciated.