我想弄清楚如何連接到IBM informix數據庫。我一直在做一些研究,並在5年前發現了一些線索,但這些例子並不奏效。連接到informix數據庫窗體窗體應用程序
我已經從IBM爲informix安裝了最新的SDK。
我已經在我的項目中引用了IBM.Data.Informix.dll。
我已經包含了使用IBM.Data.Informix;
我只是添加一個按鈕,然後單擊測試連接。我總是得到這個調試錯誤 「SQL0035N無法打開文件」C:\ Users \ Adam \ documents \ visual studio 2010 \ Projects \ test \ test \ msg \ en_US \ db2nmp.xml「。」
該文件不存在,我在Program Files(x86)\ IBM Informix Client SDK目錄中的任何位置都看不到它。
我的點擊代碼
private void button1_Click(object sender, EventArgs e)
{
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";
string ConnectionString = "Host=" + HOST + "; " +
"Service=" + SERVICENUM + "; " +
"Server=" + SERVER + "; " +
"Database=" + DATABASE + "; " +
"User Id=" + USER + "; " +
"Password=" + PASSWORD + "; ";
IfxConnection conn = new IfxConnection();
conn.ConnectionString = ConnectionString;
try
{
conn.Open();
MessageBox.Show("Made connection!");
}
catch (IfxException ex)
{
MessageBox.Show("Problem with connection attempt: " + ex.Message);
}
}
任何人都知道我做錯了,或者當前最好的方式連接到Informix數據庫?
在此先感謝。
這與錯誤發生在conn.ConnectionString = ConnectionString;上有什麼關係。我實際上沒有安裝它,只是爲我正在做的事情做準備。我將在我的服務器上安裝informix,然後再試一次。但我高度懷疑,這是什麼導致它錯誤,而不是隻是觸及了捕捉。我需要從某處複製msg \ en_US \ db2nmp.xml嗎? – Bowenac 2014-09-10 21:27:41