Informix can't connect via IBM.Data.Informix
I'm trying to connect to Informix database using sample code from https://www.ibm.com/developerworks/data/library/techarticle/dm-0510durity/ I'm using IBM.Data.Informix.dll version 9.7.4.4
I get an error: "argument is not correct": This is my code:
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();
}
This settings works on RazorSQL to connect:
Please help!
I have had installed 64 bit version of IBM tools. Removing everything and installed 32 bit version helps.
精彩评论