C# Class NSoft.NFramework.Data.PostgreSql.EnterpriseLibrary.NpgsqlDatabase

Inheritance: Microsoft.Practices.EnterpriseLibrary.Data.Database
Afficher le fichier Open project: debop/NFramework Class Usage Examples

Méthodes publiques

Méthode Description
AddInParameter ( DbCommand command, string name, NpgsqlDbType dbType ) : void

Adds a new In DbParameter object to the given command.

This version of the method is used when you can have the same parameter object multiple times with different values.

AddInParameter ( DbCommand command, string name, NpgsqlDbType dbType, object value ) : void

Adds a new In DbParameter object to the given command.

AddInParameter ( DbCommand command, string name, NpgsqlDbType dbType, string sourceColumn, DataRowVersion sourceVersion ) : void

Adds a new In DbParameter object to the given command.

AddOutParameter ( DbCommand command, string name, NpgsqlDbType dbType, int size ) : void

Adds a new Out DbParameter object to the given command.

AddParameter ( DbCommand command, string name, NpgsqlDbType dbType, ParameterDirection direction, string sourceColumn, DataRowVersion sourceVersion, object value ) : void

Adds a new instance of a DbParameter object to the command.

AddParameter ( DbCommand command, string name, NpgsqlDbType dbType, int size, ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value ) : void

Adds a new instance of a DbParameter object to the command.

BuildParameterName ( string name ) : string

Builds a value parameter name for the current database.

CheckIfNpgsqlCommand ( DbCommand command ) : NpgsqlCommand

Checks if a database command is a Npgsql command and converts.

ExecuteDataSet ( DbTransaction transaction, string storedProcedureName ) : DataSet

Executes the storedProcedureName with parameterValues as part of the transaction and returns the results in a new T:System.Data.DataSet within a transaction.

ExecuteDataSet ( string storedProcedureName ) : DataSet

Executes the storedProcedureName with parameterValues and returns the results in a new T:System.Data.DataSet.

ExecuteNonQuery ( DbTransaction transaction, string storedProcedureName ) : int

Executes the storedProcedureName using the given parameterValues within a transaction and returns the number of rows affected.

ExecuteNonQuery ( string storedProcedureName ) : int

Executes the storedProcedureName using the given parameterValues and returns the number of rows affected.

ExecuteReader ( DbTransaction transaction, string storedProcedureName ) : IDataReader

Executes the storedProcedureName with the given parameterValues within the given transaction and returns an through which the result can be read. It is the responsibility of the caller to close the connection and reader when finished.

ExecuteReader ( string storedProcedureName ) : IDataReader

Executes the storedProcedureName with the given parameterValues and returns an through which the result can be read. It is the responsibility of the caller to close the connection and reader when finished.

ExecuteScalar ( DbTransaction transaction, string storedProcedureName ) : object

Executes the storedProcedureName with the given parameterValues within a transaction and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored.

ExecuteScalar ( string storedProcedureName ) : object

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

NpgsqlDatabase ( string connectionString ) : System

생성자

Méthodes protégées

Méthode Description
ConfigureParameter ( DbParameter param, string name, DbType dbType, int size, ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value ) : void

Configures a given DbParameter.

CreateParameter ( string name, NpgsqlDbType dbType, int size, ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value ) : DbParameter

Adds a new instance of a DbParameter object.

SameNumberOfParametersAndValues ( DbCommand command, object values ) : bool

Determines if the number of parameters in the command matches the array of parameter values.

UserParametersStartIndex ( ) : int

Returns the starting index for parameters in a command.

Private Methods

Méthode Description
ConfigureParameter ( Npgsql.NpgsqlParameter parameter, string name, NpgsqlDbType dbType, int size, ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value ) : void
DeriveParameters ( DbCommand discoveryCommand ) : void
OnNpgsqlRowUpdated ( object sender, Npgsql.NpgsqlRowUpdatedEventArgs rowThatCouldNotBeWritten ) : void

Called when [NPGSQL row updated].

SetUpRowUpdatedEvent ( DbDataAdapter adapter ) : void

Method Details

AddInParameter() public méthode

Adds a new In DbParameter object to the given command.
This version of the method is used when you can have the same parameter object multiple times with different values.
public AddInParameter ( DbCommand command, string name, NpgsqlDbType dbType ) : void
command System.Data.Common.DbCommand The command to add the in parameter.
name string The name of the parameter.
dbType NpgsqlDbType One of the values.
Résultat void

AddInParameter() public méthode

Adds a new In DbParameter object to the given command.
public AddInParameter ( DbCommand command, string name, NpgsqlDbType dbType, object value ) : void
command System.Data.Common.DbCommand The commmand to add the parameter.
name string The name of the parameter.
dbType NpgsqlDbType One of the values.
value object The value of the parameter.
Résultat void

AddInParameter() public méthode

Adds a new In DbParameter object to the given command.
public AddInParameter ( DbCommand command, string name, NpgsqlDbType dbType, string sourceColumn, DataRowVersion sourceVersion ) : void
command System.Data.Common.DbCommand The command to add the parameter.
name string The name of the parameter.
dbType NpgsqlDbType One of the values.
sourceColumn string The name of the source column mapped to the DataSet and used for loading or returning the value.
sourceVersion DataRowVersion One of the values.
Résultat void

AddOutParameter() public méthode

Adds a new Out DbParameter object to the given command.
public AddOutParameter ( DbCommand command, string name, NpgsqlDbType dbType, int size ) : void
command System.Data.Common.DbCommand The command to add the out parameter.
name string The name of the parameter.
dbType NpgsqlDbType One of the values.
size int The maximum size of the data within the column.
Résultat void

AddParameter() public méthode

Adds a new instance of a DbParameter object to the command.
public AddParameter ( DbCommand command, string name, NpgsqlDbType dbType, ParameterDirection direction, string sourceColumn, DataRowVersion sourceVersion, object value ) : void
command System.Data.Common.DbCommand The command to add the parameter.
name string The name of the parameter.
dbType NpgsqlDbType One of the values.
direction ParameterDirection One of the values.
sourceColumn string The name of the source column mapped to the DataSet and used for loading or returning the .
sourceVersion DataRowVersion One of the values.
value object The value of the parameter.
Résultat void

AddParameter() public méthode

Adds a new instance of a DbParameter object to the command.
public AddParameter ( DbCommand command, string name, NpgsqlDbType dbType, int size, ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value ) : void
command System.Data.Common.DbCommand The command to add the parameter.
name string The name of the parameter.
dbType NpgsqlDbType One of the values.
size int The maximum size of the data within the column.
direction ParameterDirection One of the values.
nullable bool A value indicating whether the parameter accepts (Nothing in Visual Basic) values.
precision byte The maximum number of digits used to represent the .
scale byte The number of decimal places to which is resolved.
sourceColumn string The name of the source column mapped to the DataSet and used for loading or returning the .
sourceVersion DataRowVersion One of the values.
value object The value of the parameter.
Résultat void

BuildParameterName() public méthode

Builds a value parameter name for the current database.
public BuildParameterName ( string name ) : string
name string The name of the parameter.
Résultat string

CheckIfNpgsqlCommand() public static méthode

Checks if a database command is a Npgsql command and converts.
public static CheckIfNpgsqlCommand ( DbCommand command ) : NpgsqlCommand
command System.Data.Common.DbCommand The command.
Résultat Npgsql.NpgsqlCommand

ConfigureParameter() protected méthode

Configures a given DbParameter.
protected ConfigureParameter ( DbParameter param, string name, DbType dbType, int size, ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value ) : void
param System.Data.Common.DbParameter The to configure.
name string The name of the parameter.
dbType DbType One of the values.
size int The maximum size of the data within the column.
direction ParameterDirection One of the values.
nullable bool A value indicating whether the parameter accepts (Nothing in Visual Basic) values.
precision byte The maximum number of digits used to represent the .
scale byte The number of decimal places to which is resolved.
sourceColumn string The name of the source column mapped to the DataSet and used for loading or returning the .
sourceVersion DataRowVersion One of the values.
value object The value of the parameter.
Résultat void

CreateParameter() protected méthode

Adds a new instance of a DbParameter object.
protected CreateParameter ( string name, NpgsqlDbType dbType, int size, ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value ) : DbParameter
name string The name of the parameter.
dbType NpgsqlDbType One of the values.
size int The maximum size of the data within the column.
direction ParameterDirection One of the values.
nullable bool A value indicating whether the parameter accepts (Nothing in Visual Basic) values.
precision byte The maximum number of digits used to represent the .
scale byte The number of decimal places to which is resolved.
sourceColumn string The name of the source column mapped to the DataSet and used for loading or returning the .
sourceVersion DataRowVersion One of the values.
value object The value of the parameter.
Résultat System.Data.Common.DbParameter

ExecuteDataSet() public méthode

Executes the storedProcedureName with parameterValues as part of the transaction and returns the results in a new T:System.Data.DataSet within a transaction.
public ExecuteDataSet ( DbTransaction transaction, string storedProcedureName ) : DataSet
transaction System.Data.Common.DbTransaction The to execute the command within.
storedProcedureName string The stored procedure to execute.
Résultat System.Data.DataSet

ExecuteDataSet() public méthode

Executes the storedProcedureName with parameterValues and returns the results in a new T:System.Data.DataSet.
public ExecuteDataSet ( string storedProcedureName ) : DataSet
storedProcedureName string The stored procedure to execute.
Résultat System.Data.DataSet

ExecuteNonQuery() public méthode

Executes the storedProcedureName using the given parameterValues within a transaction and returns the number of rows affected.
public ExecuteNonQuery ( DbTransaction transaction, string storedProcedureName ) : int
transaction System.Data.Common.DbTransaction The to execute the command within.
storedProcedureName string The name of the stored procedure to execute.
Résultat int

ExecuteNonQuery() public méthode

Executes the storedProcedureName using the given parameterValues and returns the number of rows affected.
public ExecuteNonQuery ( string storedProcedureName ) : int
storedProcedureName string The name of the stored procedure to execute.
Résultat int

ExecuteReader() public méthode

Executes the storedProcedureName with the given parameterValues within the given transaction and returns an through which the result can be read. It is the responsibility of the caller to close the connection and reader when finished.
public ExecuteReader ( DbTransaction transaction, string storedProcedureName ) : IDataReader
transaction System.Data.Common.DbTransaction The to execute the command within.
storedProcedureName string The command that contains the query to execute.
Résultat IDataReader

ExecuteReader() public méthode

Executes the storedProcedureName with the given parameterValues and returns an through which the result can be read. It is the responsibility of the caller to close the connection and reader when finished.
public ExecuteReader ( string storedProcedureName ) : IDataReader
storedProcedureName string The command that contains the query to execute.
Résultat IDataReader

ExecuteScalar() public méthode

Executes the storedProcedureName with the given parameterValues within a transaction 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 ( DbTransaction transaction, string storedProcedureName ) : object
transaction System.Data.Common.DbTransaction The to execute the command within.
storedProcedureName string The stored procedure to execute.
Résultat object

ExecuteScalar() public méthode

Executes the storedProcedureName with the given parameterValues 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 ( string storedProcedureName ) : object
storedProcedureName string The stored procedure to execute.
Résultat object

NpgsqlDatabase() public méthode

생성자
public NpgsqlDatabase ( string connectionString ) : System
connectionString string
Résultat System

SameNumberOfParametersAndValues() protected méthode

Determines if the number of parameters in the command matches the array of parameter values.
protected SameNumberOfParametersAndValues ( DbCommand command, object values ) : bool
command System.Data.Common.DbCommand The containing the parameters.
values object The array of parameter values.
Résultat bool

UserParametersStartIndex() protected méthode

Returns the starting index for parameters in a command.
protected UserParametersStartIndex ( ) : int
Résultat int