m-y*_*m-y 5 .net c# informix database-connection visual-studio-2010
服务器信息
Sun Microsystems Inc. SunOS 5.8 通用补丁 2001 年 10 月
服务器:Informix Dynamic Server 版本 7.31.UD3
信息:
基本上,我没有成功连接到 Informix DB。我已经删除了 Client SDK 的所有迹象。此时,我不知道该怎么办。我不知道我是否使用了正确版本的 ConnectionDriver,或者我是否可以以某种方式使用 dll 并在 VS.NET 内部设置连接,但似乎没有任何效果。任何只是获得工作连接的帮助都会很棒:
示例代码(来自文章):
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();
}
}
}
Run Code Online (Sandbox Code Playgroud)