J.H.,
In the WeatherData class, in the ZipCodeLookup procedure, replace this line of code:
decLongitude = CType(strZipCodeCoordinates.Substring( _
strZipCodeCoordinates.IndexOf(",") + 2, _
strZipCodeCoordinates.IndexOf(",", _
strZipCodeCoordinates.IndexOf(",") - _
strZipCodeCoordinates.IndexOf(","))), Decimal)
with
decLongitude = CType(strZipCodeCoordinates.Substring( _
strZipCodeCoordinates.IndexOf(",") + 2, _
strZipCodeCoordinates.IndexOf(",", _
strZipCodeCoordinates.IndexOf(",") - _
strZipCodeCoordinates.IndexOf(","))).Replace(",", ""), Decimal)
It appears that the original code isleaving a comma in the string in some cases which cannot be converted to a decimal value.
Thearon
|