private DataSet GetCustomQueryDetail(OracleHelpMes ora, string queryid, string version)
        {
            string ssql = @"SELECT QUERYID,
       VERSION,
       QUERYSTRING,
       OLDQUERYSTRING,
       DESCRIPTION,
       LASTEVENTUSER,
       LASTEVENTDATE
  FROM CT_CUSTOMQUERY
 WHERE NVL (QUERYID, ' ') LIKE :QUERYID AND NVL (VERSION, ' ') LIKE :VERSION";

            OracleCommand cmd = new OracleCommand();

            cmd.CommandText = ssql;
            if (string.IsNullOrEmpty(queryid))
            {
                queryid = "%";
            }

            cmd.Parameters.Add(new OracleParameter("QUERYID", queryid));
            cmd.Parameters.Add(new OracleParameter("VERSION", version + "%"));

            DataSet ds = ora.GetDataSet(cmd);

            return(ds);
        }
        private void frmFemCustomQuery_Load(object sender, EventArgs e)
        {
            string prod = ConfigurationManager.AppSettings["PROD"].ToString();
            string test = ConfigurationManager.AppSettings["TEST"].ToString();

            string prodConnectStr = ConfigurationManager.ConnectionStrings[prod].ConnectionString.ToString();
            string testConnectStr = ConfigurationManager.ConnectionStrings[test].ConnectionString.ToString();

            oraProdEnv         = new OracleHelpMes();
            oraProdEnv.baseStr = prodConnectStr;

            oraTestEnv         = new OracleHelpMes();
            oraTestEnv.baseStr = testConnectStr;

            lblEnvProd.Text = prod;
            lblEnvTest.Text = test;

            cmbProdQueryId.Items.AddRange(this.GetCustomQueryList(oraProdEnv).ToArray());
            cmbTestQueryId.Items.AddRange(this.GetCustomQueryList(oraTestEnv).ToArray());

            dtParam = new DataTable();
            dtParam.Columns.Add("Param");
            dtParam.Columns.Add("Value");
            dtParam.TableName = "Param";
        }
        private List <string> GetCustomQueryList(OracleHelpMes ora)
        {
            List <string> lstStr = new List <string>();

            string  ssql = "SELECT DISTINCT(QUERYID)  FROM CT_CUSTOMQUERY order by QUERYID";
            DataSet ds   = ora.GetDataSet(ssql);

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    lstStr.Add(dr["QUERYID"].ToString());
                }
            }

            return(lstStr);
        }