public void select(DbConnection conn)
        {
            if (conn.State != ConnectionState.Open)
            {
                conn.Open();
            }

            DataTable tb = new DataTable();

            this.DAOList_ = new List <CALCULATION_SERVER_STATUS_Table_DAO>();

            DbCommand dbCommand = conn.CreateCommand();

            string selectQuery = CALCULATION_SERVER_STATUS_Table_DAOManager.SelectQuery_;



            //selectQuery = selectQuery.Replace("@KeyColumnValue@", this.KeyColumn_);

            dbCommand.CommandText = selectQuery;

            //DbDataAdapter dataAdapter = new DbDataAdapter(dbCommand, conn);
            DbDataAdapter dataAdapter = DataBaseConnectManager.CreateDataAdapter(dbCommand, conn);

            dataAdapter.Fill(tb);

            DataRow[] dr       = tb.Select();
            int       rowCount = dr.Length;

            foreach (DataRow item in dr)
            {
                CALCULATION_SERVER_STATUS_Table_DAO dao = new CALCULATION_SERVER_STATUS_Table_DAO();

                dao.SERVER_NAME_        = item[0].ToString();
                dao.SERVER_IP_          = item[1].ToString();
                dao.SERVER_PORT_        = item[2].ToString();
                dao.SERVER_STATUS_      = item[3].ToString();
                dao.SERVER_CORENUM_     = item[4].ToString();
                dao.SERVER_USE_         = item[5].ToString();
                dao.SERVER_ALIVETIME_   = item[6].ToString();
                dao.SERVER_DESCRIPTION_ = item[7].ToString();

                this.DAOList_.Add(dao);
            }
        }
예제 #2
0
        public void select(DbConnection conn)
        {
            if (conn.State != ConnectionState.Open)
            {
                conn.Open();
            }

            DataTable tb = new DataTable();

            this.DAOList_ = new List <CALCULATION_QUEUE_INFO_Table_DAO>();

            DbCommand dbCommand = conn.CreateCommand();

            string selectQuery = CALCULATION_QUEUE_INFO_Table_DAOManager.SelectQuery_;



            //selectQuery = selectQuery.Replace("@KeyColumnValue@", this.KeyColumn_);

            dbCommand.CommandText = selectQuery;

            //DbDataAdapter dataAdapter = new DbDataAdapter(dbCommand, conn);
            DbDataAdapter dataAdapter = DataBaseConnectManager.CreateDataAdapter(dbCommand, conn);

            dataAdapter.Fill(tb);

            DataRow[] dr       = tb.Select();
            int       rowCount = dr.Length;

            foreach (DataRow item in dr)
            {
                CALCULATION_QUEUE_INFO_Table_DAO dao = new CALCULATION_QUEUE_INFO_Table_DAO();

                dao.INST_CODE_         = item[0].ToString();
                dao.INST_TYPE_         = item[1].ToString();
                dao.INST_NAME_         = item[2].ToString();
                dao.PARA_DATE_         = item[3].ToString();
                dao.CALCULATION_STATE_ = item[4].ToString();

                this.DAOList_.Add(dao);
            }
        }