We can't help: this is going to be largely down to your data, and the design of your database, and we have no access to either.
So, it's going to be up to you.
Fortunately, you have a tool available to you which will help you find out what is going on: the debugger. How you use it depends on your compiler system, but a quick Google for the name of your IDE and "debugger" should give you the info you need.
Put a breakpoint on the line
Then run your code through the debugger. When it hits, use the debugger to look at exactly what you are passing to the DB. Then check the DB table definition and check what datatype that column expects. When it doesn't match, that's when you have a problem, and you can back-track (or run it again and look more closely) to find out why.
Sorry, but we can't do that for you - time for you to learn a new (and very, very useful) skill: debugging!