Exemplo n.º 1
0
        /// <summary>
        /// Invoked to execute the associated command and returns the integer produced by that
        /// execution.
        /// </summary>
        protected override int OnExecute()
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException(this.ToString());
            }
            if (Command.IsDisposed)
            {
                throw new ObjectDisposedException(Command.ToString());
            }
            if (Command.Link.IsDisposed)
            {
                throw new ObjectDisposedException(Command.Link.ToString());
            }

            SurrogateDirect surrogate = null;
            int             result    = 0;

            try
            {
                surrogate = new SurrogateDirect(Command);
                result    = surrogate.OnExecuteScalar();
            }
            finally
            {
                if (surrogate != null)
                {
                    try { surrogate.Dispose(); }
                    catch { }
                }
            }

            return(result);
        }
Exemplo n.º 2
0
		/// <summary>
		/// Invoked to execute the associated command and returns the integer produced by that
		/// execution.
		/// </summary>
		protected override int OnExecute()
		{
			if (IsDisposed) throw new ObjectDisposedException(this.ToString());
			if (Command.IsDisposed) throw new ObjectDisposedException(Command.ToString());
			if (Command.Link.IsDisposed) throw new ObjectDisposedException(Command.Link.ToString());

			SurrogateDirect surrogate = null;
			int result = 0;

			try
			{
				surrogate = new SurrogateDirect(Command);
				result = surrogate.OnExecuteScalar();
			}
			finally
			{
				if (surrogate != null)
				{
					try { surrogate.Dispose(); }
					catch { }
				}
			}

			return result;
		}
Exemplo n.º 3
0
 /// <summary>
 /// Invoked to reset this enumerator so that is can execute its associated command again.
 /// </summary>
 protected override void OnReset()
 {
     if (_Surrogate != null)
     {
         _Surrogate.OnReaderReset();
     }
     _Surrogate = null;
 }
		/// <summary>
		/// Invoked to reset this enumerator so that is can execute its associated command again.
		/// </summary>
		protected override void OnReset()
		{
			if (_Surrogate != null) _Surrogate.OnReaderReset();
			_Surrogate = null;
		}
		/// <summary>
		/// Invoked to execute the command returning the schema that describes the record to be
		/// produced by that execution.
		/// </summary>
		/// <returns>The schema of the records to be produced.</returns>
		protected override Core.ISchema OnReaderStart()
		{
			_Surrogate = new SurrogateDirect(Command);
			return _Surrogate.OnReaderStart();
		}
Exemplo n.º 6
0
 /// <summary>
 /// Invoked to execute the command returning the schema that describes the record to be
 /// produced by that execution.
 /// </summary>
 /// <returns>The schema of the records to be produced.</returns>
 protected override Core.ISchema OnReaderStart()
 {
     _Surrogate = new SurrogateDirect(Command);
     return(_Surrogate.OnReaderStart());
 }