error-message-to-problem translation: Object must implement IConvertible

The error “System.InvalidCastException: Object must implement IConvertible” in the context of saving things to a database (in my case through a command object with pre-set typed parameters) means that you’re asking the command object to set a parameter with an incompatible type.

In my case, I was trying to set a SqlDbType.Text field in my stored procedure with a System.Type object.

Posted on 03 Feb 05 by Helen Emerson (last updated on 03 Feb 05).
Filed under .NET