Exemple #1
0
 public void BindParameters(UtlParameterCollection paramCollection, bool isNamedParameters)
 {
     for (int i = 0; i < this._parameterNames.Length; i++)
     {
         UtlParameter parameter;
         string       str = this._parameterNames[i];
         if (isNamedParameters)
         {
             parameter = paramCollection[str];
         }
         else
         {
             parameter = paramCollection[i];
         }
         if (parameter == null)
         {
             throw new ArgumentException("Missing Parameter " + str);
         }
         if ((this._parameterModes[i] == 1) && (parameter.Direction != ParameterDirection.Input))
         {
             throw new ArgumentException(parameter.Direction.ToString());
         }
         if ((this._parameterModes[i] == 4) && (parameter.Direction != ParameterDirection.Output))
         {
             throw new ArgumentException(parameter.Direction.ToString());
         }
         if (((this._parameterModes[i] == 2) && (parameter.Direction != ParameterDirection.Output)) && ((parameter.Direction != ParameterDirection.Input) && (parameter.Direction != ParameterDirection.InputOutput)))
         {
             throw new ArgumentException(parameter.Direction.ToString());
         }
         this.SetParameter(i, parameter);
         this._streamLengths[i] = parameter.Size;
     }
 }
Exemple #2
0
        public Result Execute(UtlParameterCollection parameters, int maxrows, int fetchsize, bool updatable)
        {
            Result resultIn = null;

            this.BindParameters(this._command.Parameters, this._isNamedParameters);
            this.PerformPreExecute();
            try
            {
                this._resultOut.ParameterMetaData = this._pmdDescriptor;
                if (this._command.CommandType == CommandType.StoredProcedure)
                {
                    this._resultOut.SetPreparedResultUpdateProperties(this._parameterValues);
                }
                else
                {
                    this._resultOut.SetPreparedExecuteProperties(this._parameterValues, maxrows, fetchsize, ResultProperties.DefaultPropsValue);
                }
                if (updatable)
                {
                    this._resultOut.SetDataResultProperties(maxrows, fetchsize, 0x3eb, 0x3f0, 1);
                }
                resultIn = this._command.Connection.InnerConnection.SessionProxy.Execute(this._resultOut);
                if (resultIn.GetResultType() == 0x2b)
                {
                    this.SetOutParameterValues(resultIn);
                }
                this.SetReturnParameterValue(resultIn);
            }
            catch (CoreException exception1)
            {
                throw UtlException.GetException(exception1);
            }
            finally
            {
                this.PerformPostExecute(resultIn);
                this._resultOut.ClearLobResults();
            }
            if (resultIn.IsError())
            {
                UtlException.ThrowError(resultIn);
            }
            return(resultIn);
        }
Exemple #3
0
 public UtlCommand(string commandText, UtlConnection connection, UtlTransaction transaction)
 {
     this._commandTimeout      = 30;
     this._commandType         = System.Data.CommandType.Text;
     this._parameterCollection = new UtlParameterCollection(this);
     this._designTimeVisible   = true;
     this._updateRowSource     = UpdateRowSource.None;
     if (commandText != null)
     {
         this.CommandText = commandText;
     }
     if (connection != null)
     {
         this.DbConnection = connection;
     }
     if (transaction != null)
     {
         this.Transaction = transaction;
     }
     this.FetchGeneratedResults = false;
 }