Informix无法通过IBM.Data.Informix进行连接

时间:2011-09-26 13:53:13

标签: c# .net ado.net informix

我正在尝试使用https://www.ibm.com/developerworks/data/library/techarticle/dm-0510durity/中的示例代码连接到Informix数据库 我正在使用IBM.Data.Informix.dll版本9.7.4.4

我收到错误:“参数不正确”:这是我的代码:

static void Main(string[] args)
{
    MakeConnection("PLPC06", "9090", "TestServer", "clients", "informix", "Password");  
}

public static void MakeConnection(string HOST, string SERVICENUM, string SERVER, string DATABASE, string USER, string PASSWORD)
{
    string ConnectionString = "Host=" + HOST + "; " +
        "Service=" + SERVICENUM + "; " +
        "Server=" + SERVER + "; " +
        "Database=" + DATABASE + "; " +
        "User Id=" + USER + "; " +
        "Password=" + PASSWORD + "; ";
    //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!");
    }
    catch (IfxException ex)
    {
        Console.WriteLine("Problem with connection attempt: " + ex.Message);
    }

    Console.ReadLine();
}

此设置适用于RazorSQL连接:

enter image description here

请帮忙!

1 个答案:

答案 0 :(得分:0)

我已经安装了64位版本的IBM工具。删除所有内容并安装32位版本有帮助。