Which MS Visual Studio do you use ? Framework ?
Can You please provide code snippet, method You use.
I can't access HDB from home, but I'll try to take a look next week If you post additional info.
Also HDB table and table inserts or data export would be a conditio sine qua non.
Seems from the post that you know your stuff, so its probobly some silly typefeller or you're ommiting something by mistake. Give a collegue or somebody to take a look at it.
You're porting code from MS SQL ? Maybe in MS SQL ID column was self incrementing so you did not have to provide ID when inserting ? Just speculating, and that benefits no one. Sorry.
Take care