예제 #1
0
        //----------------------------------------------//
        private void button3_Click(object sender, EventArgs e)
        {
            string host = txtHost.Text;
            string user = txtUser.Text;
            string psw  = txtPsw.Text;

            db = new clDB("HOSTNAME=" + host + ";PORT=49999;DRIVER={IBM DB2 ODBC DRIVER};UID=" + user + ";PWD=" + psw + ";DATABASE=EOSLOG;PROTOCOL=TCPIP", clDB.ENUM_DB_TYPE.DB_DB2);

            //- read List of machines
            clDB.Record[] machines = db.execute_to_array("SELECT MA_ID AS F01, MA_ID || ' [' ||  MT_TYPE || ']' AS F02 FROM EOSLOG.machines_tbl ORDER BY MA_ID", "F01", "F02");


            listMachines.Items.AddRange(machines);

            //- select first machine
            if (listMachines.Items.Count > 0)
            {
                listMachines.SelectedIndex = 0;
            }


            timer_refreshState.Enabled = true;

            refreshMachinState();
        }
예제 #2
0
        //----------------------------------------------//
        private void button3_Click(object sender, EventArgs e)
        {
            string host = txtHost.Text;
            string user = txtUser.Text;
            string psw = txtPsw.Text;

            db = new clDB("HOSTNAME=" + host + ";PORT=49999;DRIVER={IBM DB2 ODBC DRIVER};UID=" + user + ";PWD=" + psw + ";DATABASE=EOSLOG;PROTOCOL=TCPIP", clDB.ENUM_DB_TYPE.DB_DB2);

            //- read List of machines
            clDB.Record[] machines = db.execute_to_array("SELECT MA_ID AS F01, MA_ID || ' [' ||  MT_TYPE || ']' AS F02 FROM EOSLOG.machines_tbl ORDER BY MA_ID", "F01", "F02");

            listMachines.Items.AddRange(machines);

            //- select first machine
            if (listMachines.Items.Count > 0) listMachines.SelectedIndex = 0;

            timer_refreshState.Enabled = true;

            refreshMachinState();
        }