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.
- In SQL Management Studio, select the Tracker table, right-click and select Script Table as>> Create To>> New Query Editor Window.
- Find the Status field in the CREATE statement and alter it from [float] to [int]. Do NOT run this script yet.
- Right-click on the HEAT database and select Tasks>> Export Data.
- Select the HEAT SQL Server, credentials and database on the "Select the source from which to copy data" screen and click Next.
- Select the HEAT SQL Server, credentials and database on the "Specify where to copy data to" screen and click Next.
- Select the "Copy data from one or more tables or views" option on the Specify Table Copy or Query screen and click Next.
- 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.
- 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.
- Once the data transfer is finished, refresh the tables and a new Tracker2 table should exist. Check the table for data integrity.
- Delete the Tracker table.
- 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].
- Refresh the table view and make sure the Tracker table is re-built and columns have proper data types.
- Run through steps 3-8 but select the Source table of Tracker2 and a Destination table of Tracker to re-populate the Tracker table.
- 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.