C# Класс Npgsql.NpgsqlCommandBuilder

Наследование: System.ComponentModel.Component
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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