Ejemplo n.º 1
0
        protected object ExecuteScalar(string queryOrProcedure, CommandType cmdType, Hashmap parameters)
        {
            object result = null;

            try
            {
                this._Conn.Open();
                this._Conn.BeginTransaction();

                result = this._Conn.ExecuteScalar(queryOrProcedure, cmdType, parameters.GetParameters());

                this._Conn.CommitTransaction();
                this._Conn.DisposeTransaction();
            }
            catch (Exception e)
            {
                this._Conn.RollbackTransaction();
                this._Conn.DisposeTransaction();
                throw;
            }
            finally
            {
                this._Conn.Close();
            }

            return(result);
        }
Ejemplo n.º 2
0
        protected DataSet GetResultSet(string queryOrProcedure, CommandType cmdType, Hashmap parameters)
        {
            DataSet ds = null;

            try
            {
                ds = this._Conn.GetResultSet(queryOrProcedure, cmdType, parameters.GetParameters());
            }
            catch (Exception e)
            {
                throw;
            }
            finally
            {
            }

            return(ds);
        }