UserDefinedTypeFormat property
The UserDefinedTypeFormat property of IfxConnection and IfxCommand sets the mapping of user-defined types to either DbType.String or DbType.Binary. Use this property instead of FetchExtendedTypesAs.
To access user-defined types as String
objects, set the UserDefinedTypeFormat attribute or the UserDefinedTypeFormat
property to string, "", or null. UDT columns and
parameters are mapped to DbType.String. The shorthand, UDTFormat,
is also a valid connection string attribute. These settings are not
case-sensitive.
To access user-defined types as Byte[] objects,
set the UserDefinedTypeFormat attribute or the UserDefinedTypeFormat
property to bytes. UDT columns and parameters are
mapped to DbType.Binary. The IfxType property of a parameter or column
is not affected.
| UserDefinedTypeFormat Setting | Operation | Result |
|---|---|---|
| string | GetBytes() | Invalid cast exception |
| string | GetString() | Returns a string |
| bytes | GetBytes() | Returns bytes |
| bytes | GetString() | Returns the binary value as a hexadecimal string |
- IfxConnection.CreateCommand()
- IfxCommand.Connection_set()
- IfxCommand.DbConnection_set()
- IfxCommand(string cmdText, IfxConnection connection)
- IfxCommand(string cmdText, IfxConnection connection, IfxTransaction transaction)
- When executing a command
- Between the first call of an IfxDataReader.Read() method and the closing of that data reader.