The DBExecution type exposes the following members.
Back to Top
Back to Top
Back to Top
Constructors
Name | Description | |
---|---|---|
DBExecution(String) |
Constructor from connection name (in web.config/app.config)
| |
DBExecution(String, String) | Obsolete.
Constructor from connection's dbtype and connection string.
|
Methods
Name | Description | |
---|---|---|
addFilter(Dictionary String, Object ) |
Add query parameter by Dictionary
| |
addFilter(Dictionary String, String ) | ||
addFilter(DBExecutionParameter) |
Add typed query parameter
| |
addFilter(List DBExecutionParameter ) |
Add typed query parameter by List
| |
addFilter(String, Object) |
Add query parameter.
| |
addResultParam |
Add result parameter. It means "return of database's function".
| |
beginTransaction |
Begin the transaction. If transaction is already begun, the transaction commited,and the restart. | |
clearFilter |
Clear sql parameters
| |
createTable |
Create(or delete) table in database, and insert all rows in DataTable.
| |
Dispose |
Implements Dispose method.
| |
endTransaction |
End the transaction.
| |
Equals | (Inherited from Object.) | |
executeDBFunction(String) | Obsolete. | |
executeDBFunction(String, String ) | Obsolete. | |
executeDBFunction 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 . | |
executeDBFunction T (String, String ) |
Execute database function (simple way).
| |
Finalize | (Inherited from Object.) | |
getErrorMsg |
Get error message. error message is set after executing sql.
| |
GetHashCode | (Inherited from Object.) | |
getRowAffected |
Get count of affected rows. It is taken from the return of ExecuteNonQuery. So the value depends on each database provider's implementation. | |
GetType | (Inherited from Object.) | |
importTable |
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 | |
MemberwiseClone | (Inherited from Object.) | |
readItemSafe(DbDataReader , Int32) |
Get item value by id (handle DbNull as String.Empty).
| |
readItemSafe(DbDataReader , String) | Obsolete.
Get item value by name (handle DbNull as String.Empty).
| |
sqlExecution |
Execute non query(like insert/update) If you want to use parameter query, you have to set parameter by addFilter(). | |
sqlIsExist |
Judge the existence of record.
| |
sqlRead(String) |
Execute select query. Get recordset by DataTable. | |
sqlRead(String, DBExecution fetchDb, DBExecution fetchDbEnd) | Obsolete. | |
sqlRead T (String, DBExecution fetchDbItem T , DBExecution fetchDbEnd) |
Execute select query. You can set delegate function for handling each record. | |
sqlReadOneRow |
Execute sql query for one record,and return the value by Dictionary of column's name and value.
| |
sqlReadScalar T |
Execute scalar query(get one value by sql)
| |
sqlReadToString |
Execute select query. And it's result is concatenated string of each delegate function's return.
| |
ToString | (Inherited from Object.) |
Properties
Name | Description | |
---|---|---|
CommandTimeout |
Timout limit for database access(the time till sql response return). Default is -1, and then apply the default setting. | |
Filter |
Parameters for sql. it is used in parameter query.
|
See Also