C# Class Habanero.DB.SqlStatement

Inheritance: ISqlStatement
Mostrar archivo Open project: Chillisoft/habanero Class Usage Examples

Public Methods

Method Description
AddParameter ( string paramName, object paramValue ) : IDbDataParameter

Adds a parameter value

AddParameter ( string paramName, object paramValue, Type paramType ) : IDbDataParameter

Adds a parameter value

AddParameterToStatement ( object obj ) : void

Adds a parameter to the sql statement

Equals ( object obj ) : bool

Indicates whether this sql statement instance is equal in content to the one specified

GetHashCode ( ) : int

Returns a hashcode calculation from the sql statement string

SetupCommand ( IDbCommand command ) : void

Sets up the IDbCommand object

SqlStatement ( IDatabaseConnection connection ) : System

Constructor to initialise a new sql statement

SqlStatement ( IDatabaseConnection connection, string statement ) : System

Constructor to initialise a new sql statement using the existing statement provided

ToString ( ) : string

Returns a string describing the sql statement and its parameters. This string cannot be used directly as a sql statement on its own.

Private Methods

Method Description
CreateParameter ( string paramName ) : IDbDataParameter
CreateParameter ( string paramName, object paramValue, Type paramType ) : IDbDataParameter
DoAfterExecute ( DatabaseConnection databaseConnection, IDbTransaction transaction, IDbCommand command ) : void

Carries out instructions after execution of the sql statement

GetParamTypeForType ( Type paramType ) : DbType
UpdateParam ( IDbDataParameter parameter, object value, DbType dbType ) : void
UpdateParameterTypeForOleDBDateTime ( object paramValue, IDbDataParameter newParameter ) : void
UpdateParameterTypeForOracleLongText ( string connectionNamespace, object paramValue, IDbDataParameter newParameter ) : void
UpdateParameterTypeForSqlServerCEImage ( string connectionNamespace, object paramValue, IDbDataParameter newParameter ) : void
databaseSpecificParameterSettings ( IDbDataParameter newParameter, object paramValue ) : void

Method Details

AddParameter() public method

Adds a parameter value
public AddParameter ( string paramName, object paramValue ) : IDbDataParameter
paramName string The parameter name
paramValue object The value to assign
return IDbDataParameter

AddParameter() public method

Adds a parameter value
public AddParameter ( string paramName, object paramValue, Type paramType ) : IDbDataParameter
paramName string The parameter name
paramValue object The value to assign
paramType System.Type The type of the parameter (only necessary if the value is null, or you wish to specify more directly the type to use when creating the parameter)
return IDbDataParameter

AddParameterToStatement() public method

Adds a parameter to the sql statement
public AddParameterToStatement ( object obj ) : void
obj object The parameter to add
return void

Equals() public method

Indicates whether this sql statement instance is equal in content to the one specified
public Equals ( object obj ) : bool
obj object The sql statement object to compare with
return bool

GetHashCode() public method

Returns a hashcode calculation from the sql statement string
public GetHashCode ( ) : int
return int

SetupCommand() public method

Sets up the IDbCommand object
public SetupCommand ( IDbCommand command ) : void
command IDbCommand The command
return void

SqlStatement() public method

Constructor to initialise a new sql statement
public SqlStatement ( IDatabaseConnection connection ) : System
connection IDatabaseConnection A database connection
return System

SqlStatement() public method

Constructor to initialise a new sql statement using the existing statement provided
public SqlStatement ( IDatabaseConnection connection, string statement ) : System
connection IDatabaseConnection A database connection
statement string An existing sql statement
return System

ToString() public method

Returns a string describing the sql statement and its parameters. This string cannot be used directly as a sql statement on its own.
public ToString ( ) : string
return string