Esempio n. 1
0
        private void frmQuery_Load(object sender, EventArgs e)
        {
            string s_path = Application.StartupPath + "\\query\\";

            string[]   array_path = Directory.GetFiles(s_path);
            DataTable  T          = new DataTable();
            DataColumn col        = T.Columns.Add("SQL範本");
            DataColumn col2       = T.Columns.Add("路徑");

            col.DataType  = System.Type.GetType("System.String");
            col2.DataType = System.Type.GetType("System.String");
            for (int j = 0; j < array_path.Length; j++)
            {
                DataRow row = T.NewRow();
                row[0] = Path.GetFileNameWithoutExtension(array_path[j]);
                row[1] = array_path[j];
                T.Rows.Add(row);
            }
            gridControl1.DataSource = T;



            Func.OracleDbConn();
            OracleCommand cmd = new OracleCommand();

            cmd.Connection = Func.MyOraSqlConn;

            cmd.CommandText = "alter session set current_schema=" + Func.t100_current_user;
            cmd.ExecuteNonQuery();
            string sql = "select max(psos002) c from psos_t where 1=1   and psosent=" + Func.t100_ent + " and psossite=" + Func.AA(Func.t100_site) + " and psos001=" + Func.AA(Func.t100_aps);

            cmd.CommandText  = sql;
            txt_max_ver.Text = cmd.ExecuteScalar().ToString();
        }