Npgsql.NpgsqlCommand.GetCommandText C# (CSharp) Method

GetCommandText() private method

This method substitutes the Parameters, if exist, in the command to their actual values. The parameter name format is :ParameterName.
private GetCommandText ( ) : byte[]
return byte[]
        internal byte[] GetCommandText()
        {
            NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "GetCommandText");

            byte[] ret = string.IsNullOrEmpty(planName) ? GetCommandText(false, false) : GetExecuteCommandText();

            return ret;
        }

Same methods

NpgsqlCommand::GetCommandText ( bool prepare, bool forExtendQuery ) : byte[]

Usage Example

コード例 #1
0
        public void WriteToStream(Stream outputStream, Encoding encoding)
        {
            //NpgsqlEventLog.LogMsg( this.ToString() + _commandText, LogLevel.Debug  );


            String commandText = _command.GetCommandText();

            // Tell to mediator what command is being sent.

            _command.Connector.Mediator.SqlSent = commandText;

            // Send the query to server.
            // Write the byte 'Q' to identify a query message.
            outputStream.WriteByte((Byte)'Q');

            if (_protocolVersion == ProtocolVersion.Version3)
            {
                // Write message length. Int32 + string length + null terminator.
                PGUtil.WriteInt32(outputStream, 4 + encoding.GetByteCount(commandText) + 1);
            }

            // Write the query. In this case it is the CommandText text.
            // It is a string terminated by a C NULL character.
            PGUtil.WriteString(commandText, outputStream, encoding);
        }
All Usage Examples Of Npgsql.NpgsqlCommand::GetCommandText