C# 클래스 Npgsql.NpgsqlCommand

Represents a SQL statement or function (stored procedure) to execute against a PostgreSQL database. This class cannot be inherited.
상속: System.Data.Common.DbCommand, ICloneable
파일 보기 프로젝트 열기: undeadlabs/Npgsql 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AddFunctionColumnListSupport void
AppendCommandReplacingParameterValues void
AppendParameterPlaceHolder void
AppendParameterPlaceHolders void
AppendParameterValue void
AppendParameterValues void
BindParameters void
BuildParameterNameCharacterTable System.Array
CheckConnectionState void
CheckFunctionNeedsColumnDefinitionList System.Boolean
ClearPoolAndCreateException NpgsqlException
ExecuteBlind void
ExecuteBlind void
ExecuteBlind void
ExecuteSetStatementTimeoutBlind void
GetCommandText byte[]
GetCommandText byte[]
GetDistinctTrimmedCommands StringChunk[]
GetExecuteCommandText byte[]
GetReader ForwardsOnlyDataReader
ICloneable Object
IsParamNameChar bool
NpgsqlCommand System
NpgsqlCommand System
PrepareInternal void
SetCommandTimeout void
UnPrepare void

공개 메소드들

메소드 설명
Cancel ( ) : void

Attempts to cancel the execution of a NpgsqlCommand.

This Method isn't implemented yet.

Clone ( ) : NpgsqlCommand

Create a new command based on this one.

CreateParameter ( ) : Npgsql.NpgsqlParameter

Creates a new instance of a NpgsqlParameter object.

ExecuteNonQuery ( ) : Int32

Executes a SQL statement against the connection and returns the number of rows affected.

ExecuteReader ( ) : Npgsql.NpgsqlDataReader

Sends the CommandText to the Connection and builds a NpgsqlDataReader.

ExecuteReader ( CommandBehavior cb ) : Npgsql.NpgsqlDataReader

Sends the CommandText to the Connection and builds a NpgsqlDataReader using one of the CommandBehavior values.

Currently the CommandBehavior parameter is ignored.

ExecuteScalar ( ) : Object

Executes the query, and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored.

NpgsqlCommand ( String cmdText ) : System

Initializes a new instance of the NpgsqlCommand class with the text of the query.

NpgsqlCommand ( String cmdText, NpgsqlConnection connection ) : System

Initializes a new instance of the NpgsqlCommand class with the text of the query and a NpgsqlConnection.

NpgsqlCommand ( String cmdText, NpgsqlConnection connection, NpgsqlTransaction transaction ) : System

Initializes a new instance of the NpgsqlCommand class with the text of the query, a NpgsqlConnection, and the NpgsqlTransaction.

Prepare ( ) : void

Creates a prepared version of the command on a PostgreSQL server.

보호된 메소드들

메소드 설명
CreateDbParameter ( ) : DbParameter

Creates a new instance of an DbParameter object.

ExecuteDbDataReader ( CommandBehavior behavior ) : System.Data.Common.DbDataReader

Sends the CommandText to the Connection and builds a NpgsqlDataReader using one of the CommandBehavior values.

비공개 메소드들

메소드 설명
AddFunctionColumnListSupport ( Stream st ) : void
AppendCommandReplacingParameterValues ( Stream dest, string src, int begin, int length, bool prepare, bool forExtendedQuery ) : void

Append a region of a source command text to an output command, performing parameter token substitutions.

AppendParameterPlaceHolder ( Stream dest, Npgsql.NpgsqlParameter parameter, int paramNumber ) : void
AppendParameterPlaceHolders ( Stream dest ) : void
AppendParameterValue ( Stream dest, Npgsql.NpgsqlParameter parameter ) : void
AppendParameterValues ( Stream dest ) : void
BindParameters ( ) : void

This method binds the parameters from parameters collection to the bind message.

BuildParameterNameCharacterTable ( ) : Array
CheckConnectionState ( ) : void

This method checks the connection state to see if the connection is set or it is open. If one of this conditions is not met, throws an InvalidOperationException

CheckFunctionNeedsColumnDefinitionList ( ) : System.Boolean
ClearPoolAndCreateException ( Exception e ) : NpgsqlException
ExecuteBlind ( NpgsqlConnector connector, NpgsqlQuery query, int timeout ) : void
ExecuteBlind ( NpgsqlConnector connector, byte command, int timeout = 20 ) : void

Internal query shortcut for use in cases where the number of affected rows is of no interest.

ExecuteBlind ( NpgsqlConnector connector, string command, int timeout = 20 ) : void

Internal query shortcut for use in cases where the number of affected rows is of no interest.

ExecuteSetStatementTimeoutBlind ( NpgsqlConnector connector, int timeout ) : void

Special adaptation of ExecuteBlind() that sets statement_timeout. This exists to prevent Connector.SetBackendCommandTimeout() from calling Command.ExecuteBlind(), which will cause an endless recursive loop.

GetCommandText ( ) : byte[]

This method substitutes the Parameters, if exist, in the command to their actual values. The parameter name format is :ParameterName.

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

Process this.commandText, trimming each distinct command and substituting paramater tokens.

GetDistinctTrimmedCommands ( string src ) : StringChunk[]

Find the beginning and end of each distinct SQL command and produce a list of descriptors, one for each command. Commands described are trimmed of leading and trailing white space and their terminating semi-colons.

GetExecuteCommandText ( ) : byte[]
GetReader ( CommandBehavior cb ) : ForwardsOnlyDataReader
ICloneable ( ) : Object

Create a new command based on this one.

IsParamNameChar ( char ch ) : bool
NpgsqlCommand ( ) : System
NpgsqlCommand ( String cmdText, NpgsqlConnector connector, int CommandTimeout = 20 ) : System

Used to execute internal commands.

PrepareInternal ( ) : void
SetCommandTimeout ( ) : void

Releases the resources used by the NpgsqlCommand.

UnPrepare ( ) : void

메소드 상세

Cancel() 공개 메소드

Attempts to cancel the execution of a NpgsqlCommand.
This Method isn't implemented yet.
public Cancel ( ) : void
리턴 void

Clone() 공개 메소드

Create a new command based on this one.
public Clone ( ) : NpgsqlCommand
리턴 NpgsqlCommand

CreateDbParameter() 보호된 메소드

Creates a new instance of an DbParameter object.
protected CreateDbParameter ( ) : DbParameter
리턴 System.Data.Common.DbParameter

CreateParameter() 공개 메소드

Creates a new instance of a NpgsqlParameter object.
public CreateParameter ( ) : Npgsql.NpgsqlParameter
리턴 Npgsql.NpgsqlParameter

ExecuteDbDataReader() 보호된 메소드

Sends the CommandText to the Connection and builds a NpgsqlDataReader using one of the CommandBehavior values.
protected ExecuteDbDataReader ( CommandBehavior behavior ) : System.Data.Common.DbDataReader
behavior CommandBehavior One of the CommandBehavior values.
리턴 System.Data.Common.DbDataReader

ExecuteNonQuery() 공개 메소드

Executes a SQL statement against the connection and returns the number of rows affected.
public ExecuteNonQuery ( ) : Int32
리턴 System.Int32

ExecuteReader() 공개 메소드

Sends the CommandText to the Connection and builds a NpgsqlDataReader.
public ExecuteReader ( ) : Npgsql.NpgsqlDataReader
리턴 Npgsql.NpgsqlDataReader

ExecuteReader() 공개 메소드

Sends the CommandText to the Connection and builds a NpgsqlDataReader using one of the CommandBehavior values.
Currently the CommandBehavior parameter is ignored.
public ExecuteReader ( CommandBehavior cb ) : Npgsql.NpgsqlDataReader
cb CommandBehavior One of the CommandBehavior values.
리턴 Npgsql.NpgsqlDataReader

ExecuteScalar() 공개 메소드

Executes the query, and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored.
public ExecuteScalar ( ) : Object
리턴 Object

NpgsqlCommand() 공개 메소드

Initializes a new instance of the NpgsqlCommand class with the text of the query.
public NpgsqlCommand ( String cmdText ) : System
cmdText String The text of the query.
리턴 System

NpgsqlCommand() 공개 메소드

Initializes a new instance of the NpgsqlCommand class with the text of the query and a NpgsqlConnection.
public NpgsqlCommand ( String cmdText, NpgsqlConnection connection ) : System
cmdText String The text of the query.
connection NpgsqlConnection A NpgsqlConnection that represents the connection to a PostgreSQL server.
리턴 System

NpgsqlCommand() 공개 메소드

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.
리턴 System

Prepare() 공개 메소드

Creates a prepared version of the command on a PostgreSQL server.
public Prepare ( ) : void
리턴 void