C# Class Habanero.DB.DatabaseConnectionSqlServer

A database connection customised for the SqlServer database
Inheritance: DatabaseConnection
Afficher le fichier Open project: Chillisoft/habanero Class Usage Examples

Méthodes publiques

Méthode Description
CreateParameterNameGenerator ( ) : IParameterNameGenerator

Creates an IParameterNameGenerator for this database connection. This is used to create names for parameters added to an ISqlStatement because each database uses a different naming convention for their parameters.

DatabaseConnectionSqlServer ( string assemblyName, string className ) : System

Constructor to initialise the connection object with an assembly name and class name

DatabaseConnectionSqlServer ( string assemblyName, string className, string connectString ) : System

Constructor to initialise the connection object with an assembly name, class name and connection string

GetLastAutoIncrementingID ( string tableName, IDbTransaction tran, IDbCommand command ) : long

Gets the value of the last auto-incrementing number. This called after doing an insert statement so that the inserted auto-number can be retrieved. The table name, current IDbTransaction and IDbCommand are passed in so that they can be used if necessary.

Méthodes protégées

Méthode Description
SetupCommand ( ISqlStatement statement, IDbCommand command, IDbTransaction transaction ) : void

Private Methods

Méthode Description
CreateIdentityOutputParameter ( IDbCommand command ) : IDbDataParameter
IsAutoIncrementingInsertStatement ( ISqlStatement statement ) : bool
SetupCommandForAutoIncrement ( IDbCommand command ) : void

Method Details

CreateParameterNameGenerator() public méthode

Creates an IParameterNameGenerator for this database connection. This is used to create names for parameters added to an ISqlStatement because each database uses a different naming convention for their parameters.
public CreateParameterNameGenerator ( ) : IParameterNameGenerator
Résultat IParameterNameGenerator

DatabaseConnectionSqlServer() public méthode

Constructor to initialise the connection object with an assembly name and class name
public DatabaseConnectionSqlServer ( string assemblyName, string className ) : System
assemblyName string The assembly name
className string The class name
Résultat System

DatabaseConnectionSqlServer() public méthode

Constructor to initialise the connection object with an assembly name, class name and connection string
public DatabaseConnectionSqlServer ( string assemblyName, string className, string connectString ) : System
assemblyName string The assembly name
className string The class name
connectString string The connection string, which can be /// generated using ConnectionStringSqlServerFactory.CreateConnectionString() ///
Résultat System

GetLastAutoIncrementingID() public méthode

Gets the value of the last auto-incrementing number. This called after doing an insert statement so that the inserted auto-number can be retrieved. The table name, current IDbTransaction and IDbCommand are passed in so that they can be used if necessary.
public GetLastAutoIncrementingID ( string tableName, IDbTransaction tran, IDbCommand command ) : long
tableName string The name of the table inserted into
tran IDbTransaction The current transaction, the one the insert was done in
command IDbCommand The Command the did the insert statement
Résultat long

SetupCommand() protected méthode

protected SetupCommand ( ISqlStatement statement, IDbCommand command, IDbTransaction transaction ) : void
statement ISqlStatement
command IDbCommand
transaction IDbTransaction
Résultat void