Unfortunately you did not answer either of my questions.

I assume based on the data and field name that TypeID is a numeric field but I can only guess since you did not say.

You also did not say what value is held in iType

My guess would be that it is empty and that would trigger an error with a numeric field type.