Informix 无法通过 IBM.Data.Informix 连接
我正在尝试使用 https: 中的示例代码连接到 Informix 数据库: //www.ibm.com/developerworks/data/library/techarticle/dm-0510durity/ 我正在使用 IBM.Data.Informix.dll 版本 9.7.4.4
我收到错误:“参数不正确”:这是我的代码:
static void Main(string[] args)
{
MakeConnection("PLPC06", "9090", "TestServer", "clients", "informix", "Password");
}
public static void MakeConnection(string HOST, string SERVICENUM, string SERVER, string DATABASE, string USER, string PASSWORD)
{
string ConnectionString = "Host=" + HOST + "; " +
"Service=" + SERVICENUM + "; " +
"Server=" + SERVER + "; " +
"Database=" + DATABASE + "; " +
"User Id=" + USER + "; " +
"Password=" + PASSWORD + "; ";
//Can add other DB parameters here like DELIMIDENT, DB_LOCALE etc
//Full list in Client SDK's .Net Provider Reference Guide p 3:13
IfxConnection conn = new IfxConnection();
conn.ConnectionString = ConnectionString;
try
{
conn.Open();
Console.WriteLine("Made connection!");
}
catch (IfxException ex)
{
Console.WriteLine("Problem with connection attempt: " + ex.Message);
}
Console.ReadLine();
}
此设置适用于 RazorSQL 来连接:
请帮忙!
I'm trying to connect to Informix database using sample code from https://www.ibm.com/developerworks/data/library/techarticle/dm-0510durity/
I'm using IBM.Data.Informix.dll version 9.7.4.4
I get an error: "argument is not correct": This is my code:
static void Main(string[] args)
{
MakeConnection("PLPC06", "9090", "TestServer", "clients", "informix", "Password");
}
public static void MakeConnection(string HOST, string SERVICENUM, string SERVER, string DATABASE, string USER, string PASSWORD)
{
string ConnectionString = "Host=" + HOST + "; " +
"Service=" + SERVICENUM + "; " +
"Server=" + SERVER + "; " +
"Database=" + DATABASE + "; " +
"User Id=" + USER + "; " +
"Password=" + PASSWORD + "; ";
//Can add other DB parameters here like DELIMIDENT, DB_LOCALE etc
//Full list in Client SDK's .Net Provider Reference Guide p 3:13
IfxConnection conn = new IfxConnection();
conn.ConnectionString = ConnectionString;
try
{
conn.Open();
Console.WriteLine("Made connection!");
}
catch (IfxException ex)
{
Console.WriteLine("Problem with connection attempt: " + ex.Message);
}
Console.ReadLine();
}
This settings works on RazorSQL to connect:
Please help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经安装了 64 位版本的 IBM 工具。删除所有内容并安装 32 位版本会有所帮助。
I have had installed 64 bit version of IBM tools. Removing everything and installed 32 bit version helps.