Npgsql.NpgsqlCommand.NpgsqlCommand C# (CSharp) Method

NpgsqlCommand() public method

Initializes a new instance of the NpgsqlCommand class with the text of the query, a NpgsqlConnection, and the NpgsqlTransaction.
public NpgsqlCommand ( String cmdText, NpgsqlConnection connection, NpgsqlTransaction transaction ) : System
cmdText String The text of the query.
connection NpgsqlConnection A NpgsqlConnection that represents the connection to a PostgreSQL server.
transaction NpgsqlTransaction The NpgsqlTransaction in which the NpgsqlCommand executes.
return System
        public NpgsqlCommand(String cmdText, NpgsqlConnection connection, NpgsqlTransaction transaction)
        {
            NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, CLASSNAME);

            planName = String.Empty;
            commandText = cmdText;
            this.connection = connection;

            if (this.connection != null)
            {
                this.m_Connector = connection.Connector;

                if (m_Connector != null && m_Connector.AlwaysPrepare)
                {
                    CommandTimeout = m_Connector.DefaultCommandTimeout;
                    prepared = PrepareStatus.NeedsPrepare;
                }
            }

            commandType = CommandType.Text;
            this.Transaction = transaction;

            SetCommandTimeout();
        }

Same methods

NpgsqlCommand::NpgsqlCommand ( ) : System
NpgsqlCommand::NpgsqlCommand ( String cmdText ) : System
NpgsqlCommand::NpgsqlCommand ( String cmdText, NpgsqlConnection connection ) : System
NpgsqlCommand::NpgsqlCommand ( String cmdText, NpgsqlConnector connector, int CommandTimeout = 20 ) : System