C# Класс Cedar.Core.EntLib.Data.DatabaseWrapper

Наследование: Database
Показать файл Открыть проект

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

Метод Описание
AddInParameter ( DbCommand command, string name, DbType dbType ) : void

Adds a new In T:System.Data.Common.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, DbType dbType, object value ) : void

Adds a new In T:System.Data.Common.DbParameter object to the given command.

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

Adds a new In T:System.Data.Common.DbParameter object to the given command.

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

Adds the out parameter.

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

Adds a new instance of a T:System.Data.Common.DbParameter object to the command.

BuildParameterName ( string parameterName ) : string

Builds DBMS specific parameter name.

CreateConnection ( ) : DbConnection

Creates the connection.

DatabaseWrapper ( Func dataAccessor, string databaseName ) : System
DiscoverParameters ( DbCommand cmd ) : void

Discovers the parameters.

ExecuteDataSet ( DbCommand command, DbTransaction transaction = null ) : DataSet

Executes the data set.

ExecuteNonQuery ( CommandType commandType, string commandText ) : int

Executes the non query.

ExecuteNonQuery ( DbCommand command, DbTransaction transaction = null ) : int
ExecuteNonQuery ( DbTransaction transaction, string storedProcedureName ) : int

Executes the non query.

ExecuteNonQuery ( string storedProcedureName ) : int

Executes the non query.

ExecuteReader ( CommandType commandType, string commandText ) : IDataReader

Executes the reader.

ExecuteReader ( DbCommand command, DbTransaction transaction = null ) : IDataReader

Executes the reader.

ExecuteReader ( string storedProcedureName ) : IDataReader

Executes the reader.

ExecuteScalar ( CommandType commandType, string commandText ) : object

Executes the scalar.

ExecuteScalar ( DbCommand command ) : object

Executes the scalar.

ExecuteScalar ( DbCommand command, DbTransaction transaction ) : object

Executes the scalar.

GetDataAdapter ( ) : DbDataAdapter

Gets a DbDataAdapter with Standard update behavior.

GetParameterValue ( DbCommand command, string name ) : object

Gets the parameter value.

GetSqlStringCommand ( string query ) : DbCommand

Build a T:System.Data.Common.DbCommand based on the SQL text.

GetStoredProcCommand ( string procedureName ) : DbCommand

Gets the stored proc command.

GetStoredProcCommandWithSourceColumns ( string storedProcedureName ) : DbCommand

Wraps around a derived class's implementation of the GetStoredProcCommandWrapper method and adds functionality for using this method with UpdateDataSet. The GetStoredProcCommandWrapper method (above) that takes a params array expects the array to be filled with VALUES for the parameters. This method differs from the GetStoredProcCommandWrapper method in that it allows a user to pass in a string array. It will also dynamically discover the parameters for the stored procedure and set the parameter's SourceColumns to the strings that are passed in. It does this by mapping the parameters to the strings IN ORDER. Thus, order is very important.

SetParameterValue ( DbCommand command, string name, object value ) : void

Sets the parameter value.

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

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

Adds a new In T:System.Data.Common.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, DbType dbType ) : void
command System.Data.Common.DbCommand The command to add the in parameter.
name string The name of the parameter.
dbType DbType One of the values.
Результат void

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

Adds a new In T:System.Data.Common.DbParameter object to the given command.
public AddInParameter ( DbCommand command, string name, DbType dbType, object value ) : void
command System.Data.Common.DbCommand The commmand to add the parameter.
name string The name of the parameter.
dbType DbType One of the values.
value object The value of the parameter.
Результат void

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

Adds a new In T:System.Data.Common.DbParameter object to the given command.
public AddInParameter ( DbCommand command, string name, DbType 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 DbType 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.
Результат void

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

Adds the out parameter.
public AddOutParameter ( DbCommand command, string name, DbType dbType, int size ) : void
command System.Data.Common.DbCommand The command.
name string The name.
dbType DbType Type of the db.
size int The size.
Результат void

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

Adds a new instance of a T:System.Data.Common.DbParameter object to the command.

public AddParameter ( DbCommand command, string name, DbType 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 DbType 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.
Результат void

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

Builds DBMS specific parameter name.
public BuildParameterName ( string parameterName ) : string
parameterName string The parameter name without any prefix symbol.
Результат string

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

Creates the connection.
public CreateConnection ( ) : DbConnection
Результат System.Data.Common.DbConnection

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

public DatabaseWrapper ( Func dataAccessor, string databaseName ) : System
dataAccessor Func
databaseName string
Результат System

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

Discovers the parameters.
public DiscoverParameters ( DbCommand cmd ) : void
cmd System.Data.Common.DbCommand The command.
Результат void

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

Executes the data set.
public ExecuteDataSet ( DbCommand command, DbTransaction transaction = null ) : DataSet
command System.Data.Common.DbCommand The command.
transaction System.Data.Common.DbTransaction The transaction.
Результат System.Data.DataSet

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

Executes the non query.
public ExecuteNonQuery ( CommandType commandType, string commandText ) : int
commandType CommandType Type of the command.
commandText string The command text.
Результат int

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

public ExecuteNonQuery ( DbCommand command, DbTransaction transaction = null ) : int
command System.Data.Common.DbCommand
transaction System.Data.Common.DbTransaction
Результат int

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

Executes the non query.
public ExecuteNonQuery ( DbTransaction transaction, string storedProcedureName ) : int
transaction System.Data.Common.DbTransaction The transaction.
storedProcedureName string Name of the stored procedure.
Результат int

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

Executes the non query.
public ExecuteNonQuery ( string storedProcedureName ) : int
storedProcedureName string Name of the stored procedure.
Результат int

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

Executes the reader.
public ExecuteReader ( CommandType commandType, string commandText ) : IDataReader
commandType CommandType Type of the command.
commandText string The command text.
Результат IDataReader

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

Executes the reader.
public ExecuteReader ( DbCommand command, DbTransaction transaction = null ) : IDataReader
command System.Data.Common.DbCommand The command.
transaction System.Data.Common.DbTransaction The transaction.
Результат IDataReader

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

Executes the reader.
public ExecuteReader ( string storedProcedureName ) : IDataReader
storedProcedureName string Name of the stored procedure.
Результат IDataReader

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

Executes the scalar.
public ExecuteScalar ( CommandType commandType, string commandText ) : object
commandType CommandType Type of the command.
commandText string The command text.
Результат object

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

Executes the scalar.
public ExecuteScalar ( DbCommand command ) : object
command System.Data.Common.DbCommand The command.
Результат object

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

Executes the scalar.
public ExecuteScalar ( DbCommand command, DbTransaction transaction ) : object
command System.Data.Common.DbCommand The command.
transaction System.Data.Common.DbTransaction The transaction.
Результат object

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

Gets a DbDataAdapter with Standard update behavior.
public GetDataAdapter ( ) : DbDataAdapter
Результат System.Data.Common.DbDataAdapter

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

Gets the parameter value.
public GetParameterValue ( DbCommand command, string name ) : object
command System.Data.Common.DbCommand The command.
name string The name.
Результат object

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

Build a T:System.Data.Common.DbCommand based on the SQL text.
public GetSqlStringCommand ( string query ) : DbCommand
query string The SQL text.
Результат System.Data.Common.DbCommand

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

Gets the stored proc command.
public GetStoredProcCommand ( string procedureName ) : DbCommand
procedureName string Name of the procedure.
Результат System.Data.Common.DbCommand

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

Wraps around a derived class's implementation of the GetStoredProcCommandWrapper method and adds functionality for using this method with UpdateDataSet. The GetStoredProcCommandWrapper method (above) that takes a params array expects the array to be filled with VALUES for the parameters. This method differs from the GetStoredProcCommandWrapper method in that it allows a user to pass in a string array. It will also dynamically discover the parameters for the stored procedure and set the parameter's SourceColumns to the strings that are passed in. It does this by mapping the parameters to the strings IN ORDER. Thus, order is very important.
public GetStoredProcCommandWithSourceColumns ( string storedProcedureName ) : DbCommand
storedProcedureName string The name of the stored procedure.
Результат System.Data.Common.DbCommand

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

Sets the parameter value.
public SetParameterValue ( DbCommand command, string name, object value ) : void
command System.Data.Common.DbCommand The command.
name string The name.
value object The value.
Результат void