Esempio n. 1
0
        /// <summary>
        /// Instant ExcuteNonQuery
        /// </summary>
        /// <param name="Ps_SQL"></param>
        /// <returns></returns>
        public static int NonQuery(string Ps_SQL, OracleParameter[] P_Params = null, CommandType P_CmdType = CommandType.Text)
        {
            int Li_RowCnt = 0;

            try
            {
                using (OraClient ORA = new OraClient(InstantConnectionName))
                {
                    using (OracleCommand cmd = new OracleCommand(Ps_SQL, ORA.Conn))
                    {
                        cmd.CommandType    = P_CmdType;
                        cmd.CommandTimeout = ORA.CommandTimeout;

                        if (P_Params != null)
                        {
                            foreach (OracleParameter param in P_Params)
                            {
                                cmd.Parameters.Add(param);
                            }
                        }

                        Li_RowCnt = cmd.ExecuteNonQuery();
                    }
                }
            }
            catch
            {
                throw;
            }
            return(Li_RowCnt);
        }
Esempio n. 2
0
        /// <summary>
        /// Instanct FillSchema
        /// </summary>
        /// <param name="Ps_SQL"></param>
        /// <param name="Ps_ConnectionName"></param>
        /// <returns></returns>
        public static DataSet Schema(string Ps_SQL, CommandType P_CmdType = CommandType.Text)
        {
            DataSet L_DataSet = null;

            try
            {
                using (OraClient ORA = new OraClient(InstantConnectionName))
                {
                    using (OracleDataAdapter DA = new OracleDataAdapter(Ps_SQL, ORA.Conn))
                    {
                        DA.SelectCommand.CommandType    = P_CmdType;
                        DA.SelectCommand.CommandTimeout = ORA.CommandTimeout;

                        L_DataSet = new DataSet();

                        DA.FillSchema(L_DataSet, SchemaType.Source);
                    }
                }
            }
            catch
            {
                throw;
            }
            return(L_DataSet);
        }
Esempio n. 3
0
        /// <summary>
        ///  Instact Fill
        /// </summary>
        /// <param name="Ps_SQL"></param>
        /// <returns></returns>
        public static DataSet Query(string Ps_SQL, OracleParameter[] P_Params = null, CommandType P_CmdType = CommandType.Text)
        {
            DataSet L_DataSet = null;

            try
            {
                using (OraClient ORA = new OraClient(InstantConnectionName))
                {
                    using (OracleDataAdapter DA = new OracleDataAdapter(Ps_SQL, ORA.Conn))
                    {
                        DA.SelectCommand.CommandType    = P_CmdType;
                        DA.SelectCommand.CommandTimeout = ORA.CommandTimeout;

                        L_DataSet = new DataSet();

                        if (P_Params != null)
                        {
                            foreach (OracleParameter param in P_Params)
                            {
                                DA.SelectCommand.Parameters.Add(param);
                            }
                        }

                        DA.Fill(L_DataSet);
                    }
                }
            }
            catch
            {
                throw;
            }
            return(L_DataSet);
        }