我正在尝试使用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连接:
请帮忙!
答案 0 :(得分:0)
我已经安装了64位版本的IBM工具。删除所有内容并安装32位版本有帮助。