Differences between .NET Providers

There are runtime differences between the Data Server .NET Provider and the 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 Data Server Provider for .NET Programmer's Guide, Informix® Edition or the Informix® .NET Provider Reference Guide.

Informix® .NET Provider

The 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®.

Data Server .NET Provider

The 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 Informix® data servers, including Informix®, 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:
Informix® .Data.DB2.dll
Although the name of the provider indicates DB2®, this is in fact the single .NET provider for Informix® data servers including Informix® and DB2®. This is the recommended assembly for new application development for Informix® Version 11.10 or later, and this is the preferred .NET provider.
Informix® .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 HCL Informix® .NET provider and the Data Server .NET Provider. Many of the features that are supported by the Data Server .NET Provider are not supported by the Informix® .NET Provider.

The following table shows these differences:

Table 1. Compare features supported by Informix® .NET Provider and Data Server .NET Provider
Feature Informix® .NET Provider 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.0Support for .NET framework 2.0 Yes

Supports 1.1 and 2.0 frameworks. Limited VSAI windows application support.

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

Supports 2.0, 3.0, and 3.5 frameworks.

Support for LINQ (Entity Framework)Support for LINQ (Entity Framework) and Entity Data Modeling (EDM) No Yes
Silverlight and AJAX development support No Yes
ASP.NET dynamic data support No Yes
ADO.NET Entity Data Modeling (EDM) support No Yes
Visual Studio Tools for Office (VSTO) development using 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 Data Server .NET Provider. For example:
  • DB_LOCALE
  • CLIENT_LOCALE
  • EXCLUSIVE

Connection pooling settings

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

In the 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 Informix® .NET Provider, the SERVER keyword should be used to specify the INFORMIXSERVER name as setup in the SetNet utility.

In theData 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 HCL Informix® .NET Provider, you can connect to a server without specifying a database. With the Data Server .NET Provider, database is a mandatory attribute.

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

String values in quotation marks in the ConnectionString property

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

Applications that use the 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 HCL Informix® .NET Provider returns the value Informix. The 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 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 Informix® .NET Provider, you can select and return the values from the LIST, MULTISET, and ROW data types.

BYTE and TEXT data types

The 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 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 Informix® .NET Provider 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 Informix® .NET Provider 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 Informix® .NET Provider.

Stored procedure differences

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

With the 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:
Informix® .NET Provider
When you use the Informix® .NET Provider, this query returns the count as decimal type.
Decimal count = (Decimal) Cmd.ExecuteScalar();
Data Server .NET Provider
When you use the Data Server .NET Provider, this query returns the count as Int32.
Int32 count = (Int32) Cmd.ExecuteScalar();

IfxDataReader.GetString() method

The 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 Informix® .NET Provider, which allows a null value and returns an empty string.

Error messages

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