Esempio n. 1
0
        /// <summary> Closes the current reader and examines the EOF and server cursor handle output parameters. </summary>
        private void CloseAndProcessFetchResult()
        {
            if (_cursor != null)
            {
                _cursor.Dispose();
                _cursor = null;
            }

            // Indicate to the command that now is the time to read any output (user) parameters
            MSSQLCommand command = (MSSQLCommand)_command;

            command.ParametersAreAvailable();

            // Determine if there are additional fetches to do, or if this is it
            if (command.ContainsParameter("@retval"))
            {
                switch ((int)command.GetParameterValue("@retval"))
                {
                case 16: _eOF = true; break;

                case 0: _eOF = false; break;

                default: throw new ConnectionException(ConnectionException.Codes.UnableToOpenCursor);
                }
            }

            // If we have not yet obtained the cursor, retrieve it (should only happen after reading the row of the open cursor call).
            if ((_cursorHandle == 0) && command.ContainsParameter("@cursor"))
            {
                _cursorHandle = (int)command.GetParameterValue("@cursor");
            }
        }
Esempio n. 2
0
        /// <summary> Closes the current reader and examines the EOF and server cursor handle output parameters. </summary>
        private void CloseAndProcessFetchResult()
        {
            FCursor.Dispose();
            FCursor = null;

            switch ((int)((MSSQLCommand)FCommand).GetParameterValue("@retval"))
            {
            case 16: FEOF = true; break;

            case 0: FEOF = false; break;

            default: throw new ConnectionException(ConnectionException.Codes.UnableToOpenCursor);
            }

            if (FCursorHandle == 0)
            {
                MSSQLCommand LCommand = (MSSQLCommand)FCommand;
                LCommand.ParametersAreAvailable();                      // Indicate to the command that now is the time to read any output (user) parameters
                FCursorHandle = (int)LCommand.GetParameterValue("@cursor");
            }
        }
Esempio n. 3
0
 public MSSQLServerCursor(MSSQLCommand command, IDataReader cursor) : base(command, cursor)
 {
 }
Esempio n. 4
0
 public MSSQLServerCursor(MSSQLCommand ACommand, IDataReader ACursor) : base(ACommand, ACursor)
 {
 }