Tiaan
Tiaan

Reputation: 699

Trying to connect to an Informix database in Visual Studio

I am trying to connect to an Informix database and need to add this reference to my project: using IBM.Data.Informix;

What package in package manager console do I need to be able to use this library? Thanks in advance!

Upvotes: 2

Views: 3526

Answers (1)

jsagrera
jsagrera

Reputation: 2013

To connect to an Informix database from .NET you have to options:

  • The Informix .NET Provider
  • The IBM Data Server .NET Provider

Have a look at this tech note which describes both .NET provider:

https://www.ibm.com/developerworks/data/library/techarticle/dm-1007dsnetids/

Both will work with Informix. The first one is the 'native' .NET provider included with CSDK (CSDK or ClientSDK is the product that includes all the Informix drivers (ODBC/OLEDB/.NET) etc.

At the moment the only way to get the drivers installed is with a stand alone package (Informix CSDK). There are some plans to get them in NuGet, so you would be able to get the drivers directly from the Visual Studio package manager without anything to install.

The second option, 'IBM Data Server .Net Provider' is included in the 'IBM Data Server' which is an 'common' set of drivers from IBM. It will allow you to connect to either DB2 or Informix (through a DRDA connection)

You can get the IBM Data Server Driver Package from the IBM website, or download the .NET drivers (and required libraries) directly from NuGet:

https://www.nuget.org/packages/IBM.Data.DB.Provider/

PM> Install-Package IBM.Data.DB.Provider 

The .NET assembly class is called 'IBM.Data.DB2.dll' There used to be a 'replacement' dll named the same as the Informix CSDK one (IBM.Data.Informix.dll) but is now deprecated. Even with that name ;) it is fully supported against Informix databases. There are some differences between the .NET providers (e.g. connection string) so if you are going to use the 'DB2' one, I suggest to check the documentation at:

https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.swg.im.dbclient.adonet.doc/doc/c0024472.html

There is also a new beta .NET provider for the new '.NET Core' supporting both Windows and Linux platforms. If you are going to develop for .NET Core, this is the one you want

https://www.nuget.org/packages/IBM.Data.DB2.Core/1.0.0.100

PM> Install-Package IBM.Data.DB2.Core

Upvotes: 4

Related Questions