C# 클래스 Npgsql.NpgsqlCommandBuilder

상속: System.ComponentModel.Component
파일 보기 프로젝트 열기: npgsql/npgsql 1 사용 예제들

공개 메소드들

메소드 설명
DeriveParameters ( NpgsqlCommand command ) : void

This method is reponsible to derive the command parameter list with values obtained from function definition. It clears the Parameters collection of command. Also, if there is any parameter type which is not supported by Npgsql, an InvalidOperationException will be thrown. Parameters name will be parameter1, parameter2, ...

GetDeleteCommand ( ) : NpgsqlCommand

Gets the automatically generated System.Data.Common.DbCommand object required to perform deletions at the data source.

GetDeleteCommand ( bool useColumnsForParameterNames ) : NpgsqlCommand

Gets the automatically generated NpgsqlCommand object required to perform deletions at the data source, optionally using columns for parameter names.

GetInsertCommand ( ) : NpgsqlCommand

Gets the automatically generated NpgsqlCommand object required to perform insertions at the data source.

GetInsertCommand ( bool useColumnsForParameterNames ) : NpgsqlCommand

Gets the automatically generated NpgsqlCommand object required to perform insertions at the data source, optionally using columns for parameter names.

GetUpdateCommand ( ) : NpgsqlCommand

Gets the automatically generated System.Data.Common.DbCommand object required to perform updates at the data source.

GetUpdateCommand ( bool useColumnsForParameterNames ) : NpgsqlCommand

Gets the automatically generated NpgsqlCommand object required to perform updates at the data source, optionally using columns for parameter names.

NpgsqlCommandBuilder ( ) : System

Initializes a new instance of the NpgsqlCommandBuilder class.

NpgsqlCommandBuilder ( Npgsql.NpgsqlDataAdapter adapter ) : System

Initializes a new instance of the NpgsqlCommandBuilder class.

QuoteIdentifier ( string unquotedIdentifier ) : string

Given an unquoted identifier in the correct catalog case, returns the correct quoted form of that identifier, including properly escaping any embedded quotes in the identifier.

UnquoteIdentifier ( string quotedIdentifier ) : string

Given a quoted identifier, returns the correct unquoted form of that identifier, including properly un-escaping any embedded quotes in the identifier.

보호된 메소드들

메소드 설명
ApplyParameterInfo ( DbParameter p, DataRow row, System statementType, bool whereClause ) : void

Applies the parameter information.

GetParameterName ( int parameterOrdinal ) : string

Returns the name of the specified parameter in the format of @p#.

GetParameterName ( string parameterName ) : string

Returns the full parameter name, given the partial parameter name.

GetParameterPlaceholder ( int parameterOrdinal ) : string

Returns the placeholder for the parameter in the associated SQL statement.

SetRowUpdatingHandler ( DbDataAdapter adapter ) : void

Registers the T:NpgsqlCommandBuilder to handle the E:NpgsqlDataAdapter.RowUpdating event for a T:NpgsqlDataAdapter.

비공개 메소드들

메소드 설명
DoDeriveParameters ( NpgsqlCommand command ) : void
RowUpdatingHandler ( object sender, Npgsql.NpgsqlRowUpdatingEventArgs e ) : void

Adds an event handler for the NpgsqlDataAdapter.RowUpdating event.

메소드 상세

ApplyParameterInfo() 보호된 메소드

Applies the parameter information.
protected ApplyParameterInfo ( DbParameter p, DataRow row, System statementType, bool whereClause ) : void
p System.Data.Common.DbParameter The parameter.
row System.Data.DataRow The row.
statementType System Type of the statement.
whereClause bool if set to true [where clause].
리턴 void

DeriveParameters() 공개 정적인 메소드

This method is reponsible to derive the command parameter list with values obtained from function definition. It clears the Parameters collection of command. Also, if there is any parameter type which is not supported by Npgsql, an InvalidOperationException will be thrown. Parameters name will be parameter1, parameter2, ...
public static DeriveParameters ( NpgsqlCommand command ) : void
command NpgsqlCommand NpgsqlCommand whose function parameters will be obtained.
리턴 void

GetDeleteCommand() 공개 메소드

Gets the automatically generated System.Data.Common.DbCommand object required to perform deletions at the data source.
public GetDeleteCommand ( ) : NpgsqlCommand
리턴 NpgsqlCommand

GetDeleteCommand() 공개 메소드

Gets the automatically generated NpgsqlCommand object required to perform deletions at the data source, optionally using columns for parameter names.
public GetDeleteCommand ( bool useColumnsForParameterNames ) : NpgsqlCommand
useColumnsForParameterNames bool /// If true, generate parameter names matching column names, if possible. /// If false, generate @p1, @p2, and so on. ///
리턴 NpgsqlCommand

GetInsertCommand() 공개 메소드

Gets the automatically generated NpgsqlCommand object required to perform insertions at the data source.
public GetInsertCommand ( ) : NpgsqlCommand
리턴 NpgsqlCommand

GetInsertCommand() 공개 메소드

Gets the automatically generated NpgsqlCommand object required to perform insertions at the data source, optionally using columns for parameter names.
public GetInsertCommand ( bool useColumnsForParameterNames ) : NpgsqlCommand
useColumnsForParameterNames bool /// If true, generate parameter names matching column names, if possible. /// If false, generate @p1, @p2, and so on. ///
리턴 NpgsqlCommand

GetParameterName() 보호된 메소드

Returns the name of the specified parameter in the format of @p#.
protected GetParameterName ( int parameterOrdinal ) : string
parameterOrdinal int The number to be included as part of the parameter's name..
리턴 string

GetParameterName() 보호된 메소드

Returns the full parameter name, given the partial parameter name.
protected GetParameterName ( string parameterName ) : string
parameterName string The partial name of the parameter.
리턴 string

GetParameterPlaceholder() 보호된 메소드

Returns the placeholder for the parameter in the associated SQL statement.
protected GetParameterPlaceholder ( int parameterOrdinal ) : string
parameterOrdinal int The number to be included as part of the parameter's name.
리턴 string

GetUpdateCommand() 공개 메소드

Gets the automatically generated System.Data.Common.DbCommand object required to perform updates at the data source.
public GetUpdateCommand ( ) : NpgsqlCommand
리턴 NpgsqlCommand

GetUpdateCommand() 공개 메소드

Gets the automatically generated NpgsqlCommand object required to perform updates at the data source, optionally using columns for parameter names.
public GetUpdateCommand ( bool useColumnsForParameterNames ) : NpgsqlCommand
useColumnsForParameterNames bool /// If true, generate parameter names matching column names, if possible. /// If false, generate @p1, @p2, and so on. ///
리턴 NpgsqlCommand

NpgsqlCommandBuilder() 공개 메소드

Initializes a new instance of the NpgsqlCommandBuilder class.
public NpgsqlCommandBuilder ( ) : System
리턴 System

NpgsqlCommandBuilder() 공개 메소드

Initializes a new instance of the NpgsqlCommandBuilder class.
public NpgsqlCommandBuilder ( Npgsql.NpgsqlDataAdapter adapter ) : System
adapter Npgsql.NpgsqlDataAdapter The adapter.
리턴 System

QuoteIdentifier() 공개 메소드

Given an unquoted identifier in the correct catalog case, returns the correct quoted form of that identifier, including properly escaping any embedded quotes in the identifier.
Unquoted identifier parameter cannot be null
public QuoteIdentifier ( string unquotedIdentifier ) : string
unquotedIdentifier string The original unquoted identifier.
리턴 string

SetRowUpdatingHandler() 보호된 메소드

Registers the T:NpgsqlCommandBuilder to handle the E:NpgsqlDataAdapter.RowUpdating event for a T:NpgsqlDataAdapter.
protected SetRowUpdatingHandler ( DbDataAdapter adapter ) : void
adapter System.Data.Common.DbDataAdapter The to be used for the update.
리턴 void

UnquoteIdentifier() 공개 메소드

Given a quoted identifier, returns the correct unquoted form of that identifier, including properly un-escaping any embedded quotes in the identifier.
Quoted identifier parameter cannot be null
public UnquoteIdentifier ( string quotedIdentifier ) : string
quotedIdentifier string The identifier that will have its embedded quotes removed.
리턴 string