C# Class CodeKing.SqlHarvester.Data.Database

A datalayer used for excecuting commands on the database.
Inheritance: IDataCommand
ファイルを表示 Open project: TheCodeKing/SqlHarvester.Net

Public Methods

Method Description
AddParameterWithValue ( IDbCommand command, string name, object value ) : void

Adds the parameter with value to the given command. This is becuase IDbCommand does not include the AddWithValue method.

BeginTransaction ( ) : void

Begins a new active transaction.

Commit ( ) : void

Commits the active transaction.

CreateCommand ( string commandText ) : IDbCommand

Creates the concrete command instance to use with this implementation.

Database ( ) : System.Data

Initializes a new instance of the DatabaseAccess class.

Database ( string connectionString ) : System.Data

Initializes a new instance of the DatabaseAccess class.

Database ( string connectionString, int connectionTimeout ) : System.Data

Initializes a new instance of the DatabaseAccess class.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ExecuteNonQuery ( IDbCommand cmd ) : int

Executes the non query

ExecuteReader ( IDbCommand cmd ) : IDataReader

Executes the reader.

ExecuteScalar ( IDbCommand cmd ) : object

Executes the scalar.

GetConnection ( ) : IDbConnection

Gets the connection.

GetConnection ( IDbCommand cmd ) : IDbConnection

Gets the connection.

Rollback ( ) : void

Rollback the active transaction.

Private Methods

Method Description
GetConnectionCheckTransaction ( ) : IDbConnection

Method Details

AddParameterWithValue() public method

Adds the parameter with value to the given command. This is becuase IDbCommand does not include the AddWithValue method.
public AddParameterWithValue ( IDbCommand command, string name, object value ) : void
command IDbCommand The command.
name string The name.
value object The value.
return void

BeginTransaction() public method

Begins a new active transaction.
public BeginTransaction ( ) : void
return void

Commit() public method

Commits the active transaction.
public Commit ( ) : void
return void

CreateCommand() public method

Creates the concrete command instance to use with this implementation.
public CreateCommand ( string commandText ) : IDbCommand
commandText string The command text.
return IDbCommand

Database() public method

Initializes a new instance of the DatabaseAccess class.
public Database ( ) : System.Data
return System.Data

Database() public method

Initializes a new instance of the DatabaseAccess class.
public Database ( string connectionString ) : System.Data
connectionString string The connection string.
return System.Data

Database() public method

Initializes a new instance of the DatabaseAccess class.
public Database ( string connectionString, int connectionTimeout ) : System.Data
connectionString string The connection string.
connectionTimeout int The connection timeout.
return System.Data

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

ExecuteNonQuery() public method

Executes the non query
public ExecuteNonQuery ( IDbCommand cmd ) : int
cmd IDbCommand The CMD.
return int

ExecuteReader() public method

Executes the reader.
public ExecuteReader ( IDbCommand cmd ) : IDataReader
cmd IDbCommand The CMD.
return IDataReader

ExecuteScalar() public method

Executes the scalar.
public ExecuteScalar ( IDbCommand cmd ) : object
cmd IDbCommand The CMD.
return object

GetConnection() public method

Gets the connection.
public GetConnection ( ) : IDbConnection
return IDbConnection

GetConnection() public method

Gets the connection.
public GetConnection ( IDbCommand cmd ) : IDbConnection
cmd IDbCommand The CMD.
return IDbConnection

Rollback() public method

Rollback the active transaction.
public Rollback ( ) : void
return void