Server Information
Sun Microsystems Inc. SunOS 5.8 Generic Patch October 2001
Server: Informix Dynamic Server Version 7.31.UD3
Information:
- Link: Connecting to Informix database from .Net
- Article: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0510durity/
- I am running Visual Studio 2010 (C# 4.0).
- I don't care if it is ODBC vs OLE DB.
- I uninstalled all the client SDKs for Informix. I have readily available the IBM Informix CSDK 3.5 ready to be installed (the article uses 2.9 in its example, but I can't find that anywhere).
- I have the sample code from the article.
Basically, I was unsuccessful at connecting to the Informix DB. I have since removed all signs of the Client SDK. At this point, I have no idea what to do. I don't know if I'm using the right version ConnectionDriver or not, or if I can somehow use a dll and setup the connection internally in VS.NET, but nothing seems to work. Any help just getting a connection to work would be great:
Sample Code (From the article):
using System;
using IBM.Data.Informix;
namespace IfxAdoPres.Basics {
public class BasicConnection {
const string HOST = "192.168.OBFUSCATED";
const string SERVICENUM = "1525"; //Port?
const string SERVER = "serverOBFUSCATED";
const string DATABASE = "dbOBFUSCATEDy";
const string USER = "myusername";
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;
try
{
conn.Open();
Console.WriteLine("Made connection!");
}
catch (IfxException ex)
{
Console.WriteLine(e.ToString());
}
Console.ReadLine();
}
public void CloseConnection()
{
conn.Close();
}
}
}