关于C# winform 连接informix-sql的问题。
发布网友
发布时间:2022-04-10 08:05
我来回答
共2个回答
热心网友
时间:2022-04-10 09:34
.net与Informix连接是有点问题。我一直用odbc来连接informix数据库,慢的问题可以用odbc连接池来解决。
热心网友
时间:2022-04-10 10:52
public void MakeConnection() {
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();
Console.WriteLine("Made connection!");
Console.ReadLine();
} catch (IfxException ex) {
Console.WriteLine("Problem with connection attempt: "
+ ex.Message);
}
}
楼主试试这个能不能解决问题.