Logging into HMC results in error:  Specified cast is not valid.

Version 1


    Logging into HMC results in error:

    Unhandled exception has occurred in your application.  If you click Continue, the application will ignore this error and attempt to continue.  If you click Quit, the application will close immediately.

    Specified cast is not valid.


    This particular error was received just after entering the HEAT credentials and clicking Ok.  The Issue was caused by an incorrectly configured field in the Tracker table.  The field was the Status field which should be a data type of "int" but was however a data type of "float".

    To fix this do the following:

    NOTE:  Backup the database before following the below steps.

    1. In SQL Management Studio, select the Tracker table, right-click and select Script Table as>> Create To>> New Query Editor Window.
    2. Find the Status field in the CREATE statement and alter it from [float] to [int].  Do NOT run this script yet.
    3. Right-click on the HEAT database and select Tasks>> Export Data.
    4. Select the HEAT SQL Server, credentials and database on the "Select the source from which to copy data" screen and click Next.
    5. Select the HEAT SQL Server, credentials and database on the "Specify where to copy data to" screen and click Next.
    6. Select the "Copy data from one or more tables or views" option on the Specify Table Copy or Query screen and click Next.
    7. Select the Tracker table from the Source tables and when [Tracker] is populated to the Destination column, change the name to Tracker2 then click Next.
    8. Click Next on the Review Data Mapping screen, then click Finish on the Save and Run Package screen and on the Complete the Wizard screen.
    9. Once the data transfer is finished, refresh the tables and a new Tracker2 table should exist.  Check the table for data integrity.
    10. Delete the Tracker table.
    11. Run the script from steps 1-2 above to re-create the Tracker table setting the Status field to the proper data type of [int].
    12. Refresh the table view and make sure the Tracker table is re-built and columns have proper data types.
    13. Run through steps 3-8 but select the Source table of Tracker2 and a Destination table of Tracker to re-populate the Tracker table.
    14. Once the transfer is complete, check the table structure and data integrity.  If no problems, delete the Tracker2 table and HMC should now connect without errors.