C# Class DBH.Helper.DBHelperBase

数据操作抽象类基类
Inheritance: IDBHelper
显示文件 Open project: bluedusk/DBHelper Class Usage Examples

Protected Properties

Property Type Description
_ErrorMsg string
_IDataReader IDataReader
_IDbCommand IDbCommand
_IDbDataAdapter IDbDataAdapter
_IDbTransaction IDbTransaction
_SqlText string

Private Properties

Property Type Description
BeginTransaction void
CommitTransaction void
ExecuteNoQuery int
ExecuteProcedureNoQuery int
ExecuteProcedureQuery System.Data.DataTable
ExecuteQuery System.Data.DataTable
ExecuteQuery System.Data.DataTable
ExecuteReader IDataReader
ExecuteScalar object
RollbackTransaction void

Public Methods

Method Description
Close ( ) : void

关闭数据操作连接

DBHelperBase ( IDbConnection myConnection ) : System

默认构造函数

DataTableDelete ( DataTable _dt ) : int
DataTableInsert ( DataTable _dt ) : int
DataTableUpdate ( DataTable _dt ) : int
ExecuteNoQuery ( string cmdText, DBHelperParmCollection parameters ) : int
ExecuteQuery ( string cmdText, DBHelperParmCollection parameters ) : DataTable
GetDataSet ( string cmdText ) : DataSet

执行Sql语句,返回结果数据Dataset

Open ( ) : void

打开数据操作连接

Protected Methods

Method Description
CreateAdapter ( string cmdText ) : IDbDataAdapter
CreateCommand ( string cmdText, CommandType commandType ) : IDbCommand

获得相应的数据命令

Private Methods

Method Description
BeginTransaction ( ) : void
CommitTransaction ( ) : void
ExecuteNoQuery ( string cmdText ) : int
ExecuteProcedureNoQuery ( string procedureName, DBHelperParmCollection parameters ) : int
ExecuteProcedureQuery ( string procedureName, DBHelperParmCollection parameters ) : DataTable
ExecuteQuery ( string cmdText ) : DataTable
ExecuteQuery ( string cmdText, string talbeName ) : DataTable
ExecuteReader ( string cmdText ) : IDataReader
ExecuteScalar ( string cmdText ) : object
RollbackTransaction ( ) : void

Method Details

Close() public method

关闭数据操作连接
public Close ( ) : void
return void

CreateAdapter() protected method

protected CreateAdapter ( string cmdText ) : IDbDataAdapter
cmdText string
return IDbDataAdapter

CreateCommand() protected method

获得相应的数据命令
protected CreateCommand ( string cmdText, CommandType commandType ) : IDbCommand
cmdText string
commandType CommandType
return IDbCommand

DBHelperBase() public method

默认构造函数
public DBHelperBase ( IDbConnection myConnection ) : System
myConnection IDbConnection
return System

DataTableDelete() public method

public DataTableDelete ( DataTable _dt ) : int
_dt System.Data.DataTable
return int

DataTableInsert() public method

public DataTableInsert ( DataTable _dt ) : int
_dt System.Data.DataTable
return int

DataTableUpdate() public method

public DataTableUpdate ( DataTable _dt ) : int
_dt System.Data.DataTable
return int

ExecuteNoQuery() public method

public ExecuteNoQuery ( string cmdText, DBHelperParmCollection parameters ) : int
cmdText string
parameters DBHelperParmCollection
return int

ExecuteQuery() public method

public ExecuteQuery ( string cmdText, DBHelperParmCollection parameters ) : DataTable
cmdText string
parameters DBHelperParmCollection
return System.Data.DataTable

GetDataSet() public method

执行Sql语句,返回结果数据Dataset
public GetDataSet ( string cmdText ) : DataSet
cmdText string Sql语句
return System.Data.DataSet

Open() public method

打开数据操作连接
public Open ( ) : void
return void

Property Details

_ErrorMsg protected_oe property

错误信息
protected string _ErrorMsg
return string

_IDataReader protected_oe property

protected IDataReader _IDataReader
return IDataReader

_IDbCommand protected_oe property

protected IDbCommand _IDbCommand
return IDbCommand

_IDbDataAdapter protected_oe property

protected IDbDataAdapter _IDbDataAdapter
return IDbDataAdapter

_IDbTransaction protected_oe property

protected IDbTransaction _IDbTransaction
return IDbTransaction

_SqlText protected_oe property

Sql命令文本
protected string _SqlText
return string