Cast from string "<string>" to type '<typename>' is not valid

An attempt to convert a string variable to another type is not valid.

To correct this error

  1. Check the types involved in the conversion and make sure you are attempting to convert to a meaningful type.

See also