DBExecution MembersDataBaseExecutors

The DBExecution type exposes the following members.
Constructors

  NameDescription
Public methodDBExecution(String)
Constructor from connection name (in web.config/app.config)
Public methodDBExecution(String, String)Obsolete.
Constructor from connection's dbtype and connection string.
Back to Top
Methods

  NameDescription
Public methodaddFilter(Dictionary String, Object  )
Add query parameter by Dictionary
Public methodaddFilter(Dictionary String, String  )
Public methodaddFilter(DBExecutionParameter)
Add typed query parameter
Public methodaddFilter(List DBExecutionParameter  )
Add typed query parameter by List
Public methodaddFilter(String, Object)
Add query parameter.
Public methodaddResultParam
Add result parameter. It means "return of database's function".
Public methodbeginTransaction
Begin the transaction.
If transaction is already begun, the transaction commited,and the restart.
Public methodclearFilter
Clear sql parameters
Public methodcreateTable
Create(or delete) table in database, and insert all rows in DataTable.
Public methodDispose
Implements Dispose method.
Public methodendTransaction
End the transaction.
Public methodEquals (Inherited from Object.)
Public methodexecuteDBFunction(String)Obsolete.
Public methodexecuteDBFunction(String,  String )Obsolete.
Public methodexecuteDBFunction T (String, DBExecution executeDbEnd T )
Execute database function.
If you want to get return value from function, you have to set parameter for return value. There are two way.
1. Use addResultParam
2. Make DBExecutionParameter and set it's Direction to ParameterDirection.ReturnValue. Then add it by addFilter.
If return value is special type(can not cast from string simply), you have to use 2 .
Public methodexecuteDBFunction T (String,  String )
Execute database function (simple way).
Protected methodFinalize (Inherited from Object.)
Public methodgetErrorMsg
Get error message. error message is set after executing sql.
Public methodGetHashCode (Inherited from Object.)
Public methodgetRowAffected
Get count of affected rows.
It is taken from the return of ExecuteNonQuery. So the value depends on each database provider's implementation.
Public methodGetType (Inherited from Object.)
Public methodimportTable
Import DataTable to database.
Key is defined by DataTable.PrimaryKey. It is used by select query and if key match then update else insert.
You can set option to DataColumn.ExtendedProperties.
* For Time stamp value
* For using table default value setting
* For ignoring column
Protected methodMemberwiseClone (Inherited from Object.)
Public methodStatic memberreadItemSafe(DbDataReader , Int32)
Get item value by id (handle DbNull as String.Empty).
Public methodStatic memberreadItemSafe(DbDataReader , String)Obsolete.
Get item value by name (handle DbNull as String.Empty).
Public methodsqlExecution
Execute non query(like insert/update)
If you want to use parameter query, you have to set parameter by addFilter().
Public methodsqlIsExist
Judge the existence of record.
Public methodsqlRead(String)
Execute select query.
Get recordset by DataTable.
Public methodsqlRead(String, DBExecution fetchDb, DBExecution fetchDbEnd)Obsolete.
Public methodsqlRead T (String, DBExecution fetchDbItem T , DBExecution fetchDbEnd)
Execute select query.
You can set delegate function for handling each record.
Public methodsqlReadOneRow
Execute sql query for one record,and return the value by Dictionary of column's name and value.
Public methodsqlReadScalar T 
Execute scalar query(get one value by sql)
Public methodsqlReadToString
Execute select query. And it's result is concatenated string of each delegate function's return.
Public methodToString (Inherited from Object.)
Back to Top
Properties

  NameDescription
Public propertyCommandTimeout
Timout limit for database access(the time till sql response return).
Default is -1, and then apply the default setting.
Public propertyFilter
Parameters for sql. it is used in parameter query.
Back to Top
See Also