Reference Information:
- Visual Studio 2010 (.NET Framework 4.0)
- Informix Server 7.31
- Informix ClientSDK 3.50 TC7 (Windows 32-bit) was also installed.
I tried several methods suggested online to connect to the Informix server, but all of them do not work for me for any reason. I looked at articles like Connect Informix with ADO.Net , and I used ConnectionStrings.com to create a connection string.
When I switch to Visual Studio, I do the following:
- Server explorer
- Right-click Data Connections> Add Connection ...
- Microsoft ODBC Data Source | .NET Framework Data Provider for ODBC
- Use the connection string (copied / pasted using ConnectionString ).
- Test connection
RESULT: ERROR [IM002] [Microsoft] [ODBC driver manager] No data source name was found and the specified driver was not specified by default.
- Server explorer
- Right-click Data Connections> Add Connection ...
- Other | .NET Framework Data Provider for ODBC
- Use the connection string (copied / pasted using ConnectionString ).
- Test connection
RESULT: ERROR [IM002] [Microsoft] [ODBC driver manager] No data source name was found and the specified driver was not specified by default.
- Server explorer
- Right-click Data Connections> Add Connection ...
- Other | .NET Framework Data Provider for OLE DB
- OLE DB Provider: IBM Informix OLE DB Provider
- Data Links ...
RESULT: The specified procedure was not found. (Exception from HRESULT: 0x8007007F)
Also, I was not sure what to actually fill in there ...
Oh, and I even tried using the sample code provided in the first article , substituting into my connection information:
, /:
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();
}
}
}
conn.ConnectionString = ConnectionString; " " InnerException ( ). :
- Basics.exe! IfxAdoPres.Basics.BasicConnection.MakeConnection()
- Basics.exe! IfxAdoPres.Basics.Test.Main(string [] args = {string [0]})
- [ ]
, ...: -/