locked
Informix ado.net data provider connection test RRS feed

  • Question

  • i download sample code for test connection. but every time when i build the solution an error occurs.

    Error 1 The type or namespace name 'IBM' could not be found (are you missing a using directive or an assembly reference?) E:\Project\TestInformixConnection\TestInformixConnection\Form1.cs 9 7 TestInformixConnection

    i added a reference : IBM.Data.Informix.dll

    and add using directive : using IBM.Data.Informix;

    and my connection code :

    string ConnectionString = "Host=" + HOST + "; " +
                 "Service=" + SERVICENUM + "; " +
                 "Server=" + SERVER + "; " +
                 "Database=" + DATABASE + "; " +
                 "User Id=" + USER + "; " +
                 "Password=" + PASSWORD + "; ";
                Console.WriteLine(ConnectionString);
                //Can add other DB parameters here like DELIMIDENT, DB_LOCALE etc
                //Full list in Client SDK's .Net Provider Reference Guide p 3:13
                IfxConnection conn = new IfxConnection();
                conn.ConnectionString = ConnectionString;
                try
                {
                    //conn.Open();
                    Console.WriteLine("Made connection!");
                    Console.ReadLine();
                }
                catch (IfxException ex)
                {
                    Console.WriteLine("Problem with connection attempt: "
                                      + ex.Message);
                }

    how can i resolve the reference problem.

    Wednesday, September 26, 2012 8:28 AM

Answers

  • Before using the ADO.NET driver to connect, you must also run a stored procedure called cdotnet.sql. It is located in the /etc directory of your SDK installation

    Karthikeya

    • Marked as answer by Bob Shen Thursday, October 4, 2012 9:45 AM
    Wednesday, September 26, 2012 9:32 AM

All replies

  • The IBM Informix ADO.Net driver is not self-contained in the IBM.Data.Informix.dll file that gets installed in the /bin directory of your installation. Apparently, it uses some of the other client code installed by the SDK. This means that you must install the Informix Client SDK on any machines that will use the ADO.Net driver. You cannot just include the IBM.Data.Informix.dll in your distribution. This could be a serious limitation for some applications. You also need to go through the SDK setup (SetNet32) to define your Informix data sources.

    Connect to Informix with ADO.NET


    Karthikeya

    Wednesday, September 26, 2012 8:33 AM
  • i install client sdk 3.70 tc3 32bits installer into my machine.and i configure with a server. i also have a informix database db_cra. so what should i do now?

    thnx in advance.

    Mohammed Sabbir

    Wednesday, September 26, 2012 9:06 AM
  • Before using the ADO.NET driver to connect, you must also run a stored procedure called cdotnet.sql. It is located in the /etc directory of your SDK installation

    Karthikeya

    • Marked as answer by Bob Shen Thursday, October 4, 2012 9:45 AM
    Wednesday, September 26, 2012 9:32 AM