Background Information:
I have tried multiple ways suggested online to connect to the Informix server, but all of them do not work for me for whatever reason. I have looked at articles such as Connect Informix with ADO.Net and I have used ConnectionStrings.com to generate a connection string.
When I go to Visual Studio I do the following:
RESULT: ERROR [IM002][Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
RESULT: ERROR [IM002][Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
RESULT: The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)
Beyond that I wasn't sure what to really fill in there...
Oh, and I even tried to use the sample code provided in the first article, substituting in my connection information:
Sample code I downloaded/altered:
using System;
using IBM.Data.Informix;
namespace IfxAdoPres.Basics {
public class BasicConnection {
const string HOST = "192.168.OBFUSCATED";
const string SERVICENUM = "5000";
const string SERVER = "myServer";
const string DATABASE = "myDatabase";
const string USER = "myUserID";
const string PASSWORD = "myPassword";
public IfxConnection conn = new IfxConnection();
public BasicConnection() {}
public void MakeConnection() {
string ConnectionString = "Host = " + HOST + "; " +
"Service=" + SERVICENUM + "; " +
"Server=" + SERVER + "; " +
"Database=" + DATABASE + "; " +
"User Id=" + USER + "; " +
"Password=" + PASSWORD + "; ";
conn.ConnectionString = ConnectionString;
}
public void CloseConnection() {
conn.Close();
}
}
}
I get an error on the line conn.ConnectionString = ConnectionString; The exception states "Invalid argument" with no InnerException (basically very unhelpful). The callstack is:
I am stuck and have no idea what to do... :-/
Well, I went back to the article: http://www.ibm.com/developerworks/data/library/techarticle/dm-0510durity/
After uninstalling everything and starting out fresh, the demo code seemed to work after installing the IBM Informix Client SDK 3.5 and using Setnet32 to configure my settings.
I must've had something corrupt since I had a couple of different of versions of the Informix Driver installed initially.
User contributions licensed under CC BY-SA 3.0