Differences between .NET Providers

There are runtime differences between the IBM® Data Server .NET Provider and the IBM Informix® .NET Provider. Knowing these differences will help you understand how each provider might affect existing applications and to select the provider that is right for your applications.

Both providers are available as part of the Client SDK for Informix.

For more information about these .NET Providers, see the IBM Data Server Provider for .NET Programmer‘s Guide, Informix Edition or the IBM Informix .NET Provider Reference Guide.

IBM Informix .NET Provider

The IBM Informix .NET Provider, sometimes referred to as the Client SDK .NET provider, works with only the Informix database server and internally uses the SQLI protocol to communicate with Informix.

IBM Data Server .NET Provider

The IBM Data Server .NET Provider, sometimes referred to as the Common .NET provider, is the next generation of the .NET provider for application development. This .NET provider includes a number of capabilities, especially in the area of web application development, making it the preferred .NET provider for new client development.

The Data Server .NET Provider works with several different IBM data servers, including Informix, IBM DB2® for Linux, UNIX, and Windows, and U2, and uses the DRDA protocol. This provider is composed of two different .NET provider assemblies that are designed for specific application developer requirements:
IBM.Data.DB2.dll
Although the name of the provider indicates IBM DB2, this is in fact the single .NET provider for IBM data servers including Informix and IBM DB2. This is the recommended assembly for new application development for Informix Version 11.10 or later, and this is the preferred .NET provider.
IBM.Data.Informix.dll
This .NET provider assembly was created to help migrate existing .NET applications that were developed by using the Informix .NET Provider to use the latest DRDA protocol. This assembly works with Informix Version 11.10 or later. This assembly includes additional support for some of the legacy Informix client features and is targeted only for .NET application development for Informix.

Comparison of supported features

There are several major differences between the features that are supported by the IBM Informix .NET provider and the IBM Data Server .NET Provider. Many of the features that are supported by the IBM Data Server .NET Provider are not supported by the IBM Informix .NET Provider.

The following table shows these differences:

Table 1. Compare features supported by Informix .NET Provider and IBM Data Server .NET Provider
Feature IBM Informix .NET Provider IBM Data Server .NET Provider
Protocol support SQLI DRDA
LOB (BLOB & CLOB) column size limit 4 TB 2 GB
Support for .NET framework 2.0 and 4.0 Yes

The Informix .NET Provider is supported to work with applications created by using the following .NET Frameworks:

  • .NET Framework 2.0
  • .NET Framework 3.0
  • .NET Framework 3.5
  • .NET Framework 4.0
  • .NET Framework 4.5
Yes
Support for LINQ (Entity Framework) and Entity Data Modeling (EDM) No Yes
VSAI support for Visual Studio 2008, web application development support, WPF and WWF enhancements No Yes
VSAI Designers to create tables, procedures, functions and triggers, run procedures and functions No Yes

Unsupported keywords in the ConnectionString property

There are several connection string keywords that are not supported by the IBM Data Server .NET Provider. For example:
  • DB_LOCALE
  • CLIENT_LOCALE
  • EXCLUSIVE

Connection pooling settings

In the IBM Informix .NET Provider, the Connection Lifetime attribute specifies how long a connection can remain open.

In the IBM Data Server .NET Provider, the Connection Lifetime attribute specifies the number of seconds that the connection can remain open and idle in the pool.

Server keyword in the ConnectionString property

In the IBM Informix .NET Provider, the SERVER keyword should be used to specify the INFORMIXSERVER name as setup in the SetNet utility.

In theIBM Data Server .NET Provider, the SERVER keyword should be specified in the format <hostname>:<port_number>, where <hostname> is the machine name of the instance and <port_number> is the port on which the instance is listening.

Database keyword in the ConnectionString property

With the IBM Informix .NET Provider, you can connect to a server without specifying a database. With the IBM Data Server .NET Provider, database is a mandatory attribute.

The IBM Informix .NET Provider allows specifying the value for the Database attribute in the format dbname@server. The IBM Data Server .NET Provider does not support this format.

String values in quotation marks in the ConnectionString property

The IBM Informix .NET Provider supports database, server, and password keyword values in quotation marks.

Applications that use the IBM Data Server .NET Provider can specify values in quotation marks for the database and password keywords only when specifying an alias for a catalog connection.

IfxConnection.ServerType property

For this property, the IBM Informix .NET Provider returns the value Informix. The IBM Data Server .NET Provider returns the value that is received from the database server to which it is connected. For example, the provider connected to an Informix database server installed on a UNIX 64-bit system might return IDS/UNIX64.

Unsupported data types in SQL statements

The IBM Data Server .NET Provider does not allow access to the LIST, MULTISET, SET, or ROW data types because the Informix DRDA server does not support these types.

With the IBM Informix .NET Provider, you can select and return the values from the LIST, MULTISET, and ROW data types.

BYTE and TEXT data types

The IBM Data Server .NET Provider maps both Byte and BLOB data types to the IfxBlob data type. When binding an IfxBlob object as a parameter, applications must use the ::byte clause after the parameter marker. This clause indicates that the IfxBlob value corresponds to a byte column. Without the ::byte clause, a conversion error is returned.

The IBM Data Server .NET Provider maps both Text and CLOB data types to the IfxClob data type. When binding an IfxClob object as a parameter, applications must use the ::text clause after the parameter marker. This clause indicates that the IfxClob value corresponds to a text column. Without the ::text clause, a conversion error is returned.
DB2Parameter clobParam;

clobParam.IfxType = IfxType.Clob;
...
cmd.CommandText = "CALL textSP(?::text)";
---
cmd.ExecuteNonQuery();

Supported data types

The following table compares the more unusual Informix data types and how each .NET provider supports those data types.

Table 2. Differences between .NET provider support for unusual Informix data types
Informix Data Type IBM Informix .NET Provider IBM Data Server .NET Provider
CLOB, BLOB Supported Limited Support. The size limitation is 2 GB.
Collection Supported Not supported
Interval DayToFraction Supported. This type must be read as a string. Not supported
IntervalMonth Supported Not supported
LIST Supported Not supported
MONEY Supported Money will be treated as decimal data type.
MULTISET Supported Not Supported
ROW Supported Not Supported
SET Supported Not Supported

Comparing classes and structures

The following table compares the differences between the .NET provider support for the data type classes and structures support.

Table 3. Differences between .NET provider support for data type classes and structures
Class / Structure IBM Informix .NET Provider IBM Data Server .NET Provider
IfxBlob Supported Limited Support. Some methods return a NotImplemented exception.
IfxClob Supported Limited Support. Some methods return a NotImplemented exception.
IfxTimeSpan Supported Not Supported
IfxMonthSpan Supported Not Supported
IfxSmartLOBLocator Supported Not Supported
IfxSmartLOB Supported Not Supported
IfxDecimal Supported Limited Support. Some methods return a NotImplemented exception.
IfxDateTime Supported Limited Support.

DRDA client supports 6 digits in the fractional part of DateTime. The Informix server supports 5 digits of the fractional value. Because of this difference, the least significant digit of the fraction will be truncated. A DateTime value read from the Informix server has a 0 (zero) added to the least significant digit to match the DRDA format. This change affects applications that access the IfxDateTime type from the IBM Informix .NET Provider.

Stored procedure differences

With the IBM Informix .NET Provider applications can read the return value of a stored procedure or function as a ReturnValue parameter.

With the IBM Data Server .NET Provider applications by default can read the return value of a stored procedure or function as a data reader. To read it as a ReturnValue parameter, applications must set the ResultSetAsReturnValue parameter to true in the IfxCommand or IfxConnection object. To read it is a ReturnValue parameter, applications must set the ResultSetAsReturnValue property to true in the IfxCommand or IfxConnection object.

IfxCommand.ExecuteScalar() method

The following query is a sample SELECT query.
Cmd.CommandText = "SELECT COUNT(*) FROM Tab";
The data type that is returned depends on the .NET provider that you use:
IBM Informix .NET Provider
When you use the IBM Informix .NET Provider, this query returns the count as decimal type.
Decimal count = (Decimal) Cmd.ExecuteScalar();
IBM Data Server .NET Provider
When you use the IBM Data Server .NET Provider, this query returns the count as Int32.
Int32 count = (Int32) Cmd.ExecuteScalar();

IfxDataReader.GetString() method

The IBM Data Server .NET Provider does not allow the IfxDataReader.GetString() method if the underlying value is null. A null value results in an InvalidCast exception. This behavior is in contrast to the IBM Informix .NET Provider, which allows a null value and returns an empty string.

Error messages

Some error messages that are received by the IBM Data Server .NET Provider might differ from the messages received by the IBM Informix .NET Provider. For example, the IBM Informix .NET Provider has tags such as [Informix .NET provider] in the error messages. The IBM Data Server .NET Provider has just [IBM] in the error messages. Additionally, the error codes might be different for the same type of error.