fixed specified cast is not valid when inserting to mysql db

When inserting data to mysql db i got the error: Specified cast is not valid. This is now fixed.