Set data types for a parameter

Your application should set the type for a parameter as the HCL Informix® type whenever possible (using the IfxType argument of IfxParameter constructor).

IfxType enumeration shows the IfxType enumeration.

You can specify a parameter type as a .NET DbType instead, and the Informix .NET Provider will infer the Informix type as best it can. The .NET DbType specifies the data type of a Parameter object of a .NET Framework data provider. Some DbType types, such as GUID, do not map to any Informix type, and an error will be returned. Some DbType types, such as AnsiString, can map to several Informix types, such as VARCHAR, TEXT, or BLOB; you must be aware that the Informix .NET Provider may not choose the data type you intend.

If you do not specify either the Informix data type or a .NET DbType, the Informix .NET Provider attempts to infer the Informix data type from the value itself. For example, if the value is 4, the provider maps this to an INTEGER data type. Relying on these inferred mappings can lead to unexpected results.