Connecting to Informix using .NET

后端 未结 2 1365
[愿得一人]
[愿得一人] 2021-01-03 07:20

Server Information
Sun Microsystems Inc. SunOS 5.8 Generic Patch October 2001
Server: Informix Dynamic Server Version 7.31.UD3

2条回答
  •  情话喂你
    2021-01-03 07:54

    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);
        }
    }
    

    See: http://www.ibm.com/developerworks/data/library/techarticle/dm-0510durity/

提交回复
热议问题