C# Класс CodeKing.SqlHarvester.Data.Database

A datalayer used for excecuting commands on the database.
Наследование: IDataCommand
Показать файл Открыть проект

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

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

Приватные методы

Метод Описание
GetConnectionCheckTransaction ( ) : IDbConnection

Описание методов

AddParameterWithValue() публичный Метод

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.
Результат void

BeginTransaction() публичный Метод

Begins a new active transaction.
public BeginTransaction ( ) : void
Результат void

Commit() публичный Метод

Commits the active transaction.
public Commit ( ) : void
Результат void

CreateCommand() публичный Метод

Creates the concrete command instance to use with this implementation.
public CreateCommand ( string commandText ) : IDbCommand
commandText string The command text.
Результат IDbCommand

Database() публичный Метод

Initializes a new instance of the DatabaseAccess class.
public Database ( ) : System.Data
Результат System.Data

Database() публичный Метод

Initializes a new instance of the DatabaseAccess class.
public Database ( string connectionString ) : System.Data
connectionString string The connection string.
Результат System.Data

Database() публичный Метод

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.
Результат System.Data

Dispose() публичный Метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

ExecuteNonQuery() публичный Метод

Executes the non query
public ExecuteNonQuery ( IDbCommand cmd ) : int
cmd IDbCommand The CMD.
Результат int

ExecuteReader() публичный Метод

Executes the reader.
public ExecuteReader ( IDbCommand cmd ) : IDataReader
cmd IDbCommand The CMD.
Результат IDataReader

ExecuteScalar() публичный Метод

Executes the scalar.
public ExecuteScalar ( IDbCommand cmd ) : object
cmd IDbCommand The CMD.
Результат object

GetConnection() публичный Метод

Gets the connection.
public GetConnection ( ) : IDbConnection
Результат IDbConnection

GetConnection() публичный Метод

Gets the connection.
public GetConnection ( IDbCommand cmd ) : IDbConnection
cmd IDbCommand The CMD.
Результат IDbConnection

Rollback() публичный Метод

Rollback the active transaction.
public Rollback ( ) : void
Результат void