I have been looking online for days trying to solve my problems and I cannot find anything which hints as to why I get this issue.
The exception is: System.ArgumentException: Invalid argument
I am using IBM.Data.Informix.dll version 9.0.0.2, the connection string has been through many permutations, but based on most examples from IBM and online this is what I have:
Database=testdb; Host=10.0.0.123; Server=test; Service=3013; User Id=testuser; Password=test123; Protocol=onsoctcp;
I have tried setting Service to the name of the service, I have removed it, even tried setting server to the IP rather than the Host. Whatever I do it just keeps coming up with a useless exception which doesn't help at all in debugging.
I am using the IfxConnection class when instanciating:
using System.Data;
using IBM.Data.Informix;
namespace InformixTest
{
public class InformixConnectionFactory : IConnectionFactory<IDbConnection>
{
private string connectionString;
public InformixConnectionFactory(string connectionString)
{
this.connectionString = connectionString;
}
public IDbConnection GetConnection()
{
return new IfxConnection(connectionString);
}
}
}
Every time it steps into the new IfxConnection(connectionString) the exception is thrown, the connection string is injected via the web.config ConnectionStrings section. I am also targeting .net 4 incase this is a problem.
I was using the v9.5fp4_nt32_dsdriver_EN.exe installer to get the driver installed, I did read somewhere once that someone had a similar issue, so they installed the Informix Client SDK, which fixed their issue. I have also done the same but no such luck.
I am using the following sites as a reference for how my connection string should look:
http://www.ibm.com/developerworks/data/library/techarticle/dm-0510durity/ http://stackoverflow.com/questions/611345/connection-string-for-informix-for-net
Any help would be great!