首页 - 代码 - C#

数据库访问通用接口

按分工来说,这部分只起把数据从数据库中读取出来,到底用ORM还是用什么传输数据,那是另外一回事情了,
这部分的功能,从分层的角度来讲,只是数据库访问层的一个实用工具而已。
我们大家都希望自己的程序能健壮一些,写一遍后到处都能运行,当然没有太理想的完美万能的通用数据库访问方法吧,
就算有万能的,我还没见到过,嘿嘿。

以前我用OleDb方式访问数据库,这样 Oracle和SqlServer上的写法大致是一致的,将程序移植到另一个数据库系统上
修改的量比较少,但是总感觉不是很爽,有时候希望用Oracle的数据库联接方式、有时候希望是SqlServer的数据库连接。
而且以前有些程序就写成了Oracle连接上,还要把这些程序都移植到新系统里来,总不能让别人翻天覆地的把程序都修改
了,我是没问题,但是别人不同意啊,当然还有性能上的问题等等。

IDbHelper 接口,里面定义了,经常用的数据库调用方法。
1. 获得数据库日期时间
2. 检查参数的安全性
3. Sql参数处理
4. 常用的数据库命令
5. 事务控制
6. 异步调用数据库
using System;
using System.Data;
using System.Data.Common;

namespace HoverTree.HtDbInterface
{
public enum HoverTreeDataBaseType
{
SqlServer,
MySql
}

/// <summary>
/// 通用数据库访问接口
/// </summary>
public interface IHoverTreeDbHelper
{
#region String GetDBNow()
/// <summary>
/// 获得数据库日期时间
/// </summary>
/// <returns>日期时间</returns>
String GetDBNow();
#endregion

#region DateTime GetDBDateTime()
/// <summary>
/// 获得数据库日期时间
/// </summary>
/// <returns>日期时间</returns>
DateTime GetDBDateTime();
#endregion

#region bool InTransaction
/// <summary>
/// 是否已采用接口
/// </summary>
/// <returns></returns>
bool InTransaction
{
get;
set;
}
#endregion

#region IDbConnection GetDbConnection()
/// <summary>
/// 获取数据库连接
/// </summary>
/// <returns>数据库连接</returns>
IDbConnection GetDbConnection();
#endregion

#region IDbTransaction GetDbTransaction()
/// <summary>
/// 获取数据源上执行的事务
/// </summary>
/// <returns>数据源上执行的事务</returns>
IDbTransaction GetDbTransaction();
#endregion

#region IDbCommand GetDbCommand()
/// <summary>
/// 获取数据源上命令
/// </summary>
/// <returns>数据源上命令</returns>
IDbCommand GetDbCommand();
#endregion


#region IDbConnection Open()
/// <summary>
/// 这时主要的获取数据库连接的方法
/// </summary>
/// <returns>数据库连接</returns>
IDbConnection Open();
#endregion

#region IDbConnection Open(String connectionString)
/// <summary>
/// 获得新的数据库连接
/// </summary>
/// <param name="connectionString">数据库连接字符串</param>
/// <returns>数据库连接</returns>
IDbConnection Open(String connectionString);
#endregion

#region bool TestConn(String dataBaseType, String dataBase, String userName, String password, String workstation, bool trustLink)
/// <summary>
/// 测试数据库连接是否成功,这里抛出异常进行加强,充分使用系统的异常功能。
/// </summary>
/// <param name="dataBaseType">数据库类别</param>
/// <param name="dataBase">数据库名称</param>
/// <param name="userName">用户名</param>
/// <param name="password">密码</param>
/// <param name="workstation">服务器名称</param>
/// <param name="trustLink">是否信任的连接</param>
/// <returns>是否连接成功</returns>
bool TestConn(HoverTreeDataBaseType dataBaseType, String dataBase, String userName, String password, String workstation, bool trustLink);
#endregion

#region String SqlSafe(String value)
/// <summary>
/// 检查参数的安全性
/// </summary>
/// <param name="value">参数</param>
/// <returns>安全的参数</returns>
String SqlSafe(String value);
#endregion

#region DbParameter GetParameter(String targetFiled, Object targetValue)
/// <summary>
/// 获取参数
/// </summary>
/// <param name="targetFiled">目标字段</param>
/// <param name="targetValue">值</param>
/// <returns>参数</returns>
DbParameter GetParameter(String targetFiled, Object myTargetValue);
#endregion

#region DbParameter[] GetParameters(String[] targetFileds, Object[] targetValues)
/// <summary>
/// 获取参数
/// </summary>
/// <param name="targetFiled">目标字段</param>
/// <param name="targetValue">值</param>
/// <returns>参数集</returns>
DbParameter[] GetParameters(String[] targetFileds, Object[] myTargetValues);
#endregion

#region void AddParameter(IDbCommand myTargetDbCommand, String targetFiled, Object targetValue)
/// <summary>
/// 添加参数
/// </summary>
/// <param name="myTargetDbCommand">数据库命令</param>
/// <param name="targetFiled">目标字段</param>
/// <param name="targetValue">值</param>
void AddParameter(IDbCommand myTargetDbCommand, String targetFiled, Object myTargetValue);
#endregion

#region String GetWhereString(String[] names, ref Object[] values, String relation)
/// <summary>
/// 获得条件语句
/// </summary>
/// <param name="names">字段名</param>
/// <param name="values">字段值</param>
/// <param name="relation">逻辑关系</param>
/// <returns>字符串</returns>
String GetWhereString(String[] names, ref Object[] values, String relation);
#endregion

#region String GetParameter(String parameter)
/// <summary>
/// 获得参数Sql表达式
/// </summary>
/// <param name="parameter">参数名称</param>
/// <returns>字符串</returns>
String GetParameter(String parameter);
#endregion

#region String PlusSign()
/// <summary>
/// 字符串相加符号
/// </summary>
/// <returns>字符加</returns>
String PlusSign();
#endregion


#region IDataReader ExecuteReader(String sqlQuery)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="sqlQuery">sql查询</param>
/// <returns>结果集流</returns>
IDataReader ExecuteReader(String sqlQuery);
#endregion

#region IDataReader ExecuteReader(String sqlQuery, DbParameter[] myDbParameters);
/// <summary>
/// 执行查询
/// </summary>
/// <param name="sqlQuery">sql查询</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>结果集流</returns>
IDataReader ExecuteReader(String sqlQuery, DbParameter[] myDbParameters);
#endregion

#region IDataReader ExecuteReader(String sqlQuery, String name, Object value)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="sqlQuery">sql查询</param>
/// <param name="name">参数名</param>
/// <param name="value">参数值</param>
/// <returns>结果集流</returns>
IDataReader ExecuteReader(String sqlQuery, String name, Object value);
#endregion

#region IDataReader ExecuteReader(String sqlQuery, String[] names, Object[] values)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="sqlQuery">sql查询</param>
/// <param name="names">参数名</param>
/// <param name="values">参数值</param>
/// <returns>结果集流</returns>
IDataReader ExecuteReader(String sqlQuery, String[] names, Object[] values);
#endregion

#region IDataReader ExecuteReader(CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>结果集流</returns>
IDataReader ExecuteReader(CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters);
#endregion

#region IDataReader ExecuteReader(CommandType myCommandType, String sqlQuery, String[] names, Object[] values)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="names">参数名</param>
/// <param name="values">参数值</param>
/// <returns>结果集流</returns>
IDataReader ExecuteReader(CommandType myCommandType, String sqlQuery, String[] names, Object[] values);
#endregion


#region int ExecuteNonQuery(String sqlQuery)
/// <summary>
/// 执行查询, SQL BUILDER 用了这个东西?参数需要保存, 不能丢失.
/// </summary>
/// <param name="sqlQuery">sql查询</param>
/// <returns>影响行数</returns>
int ExecuteNonQuery(String sqlQuery);
#endregion

#region int ExecuteNonQuery(String sqlQuery, DbParameter[] myDbParameters);
/// <summary>
/// 执行查询
/// </summary>
/// <param name="sqlQuery">sql查询</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>影响行数</returns>
int ExecuteNonQuery(String sqlQuery, DbParameter[] myDbParameters);
#endregion

#region int ExecuteNonQuery(String sqlQuery, String name, Object value)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="myDataSet">数据集</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="name">参数名</param>
/// <param name="value">参数值</param>
/// <returns>影响行数</returns>
int ExecuteNonQuery(String sqlQuery, String name, Object value);
#endregion

#region int ExecuteNonQuery(String sqlQuery, String[] names, Object[] values)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="sqlQuery">sql查询</param>
/// <param name="names">参数名</param>
/// <param name="values">参数值</param>
/// <returns>影响行数</returns>
int ExecuteNonQuery(String sqlQuery, String[] names, Object[] values);
#endregion

#region int ExecuteNonQuery(CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>影响行数</returns>
int ExecuteNonQuery(CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters);
#endregion

#region int ExecuteNonQuery(CommandType myCommandType, String sqlQuery, String[] names, Object[] values)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="names">参数名</param>
/// <param name="values">参数值</param>
/// <returns>影响行数</returns>
int ExecuteNonQuery(CommandType myCommandType, String sqlQuery, String[] names, Object[] values);
#endregion

#region int ExecuteNonQuery(IDbTransaction myOleDbTransaction, CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="myOleDbTransaction">数据库事务</param>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>影响行数</returns>
int ExecuteNonQuery(IDbTransaction myOleDbTransaction, CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters);
#endregion

#region int ExecuteNonQuery(IDbTransaction myOleDbTransaction, CommandType myCommandType, String sqlQuery, String[] names, Object[] values)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="myOleDbTransaction">数据库事务</param>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="names">参数名</param>
/// <param name="values">参数值</param>
/// <returns>影响行数</returns>
int ExecuteNonQuery(IDbTransaction myOleDbTransaction, CommandType myCommandType, String sqlQuery, String[] names, Object[] values);
#endregion


#region Object ExecuteScalar(String sqlQuery)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="sqlQuery">sql查询</param>
/// <returns>Object</returns>
Object ExecuteScalar(String sqlQuery);
#endregion

#region Object ExecuteScalar(String sqlQuery, DbParameter[] myDbParameters)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="sqlQuery">sql查询</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>Object</returns>
Object ExecuteScalar(String sqlQuery, DbParameter[] myDbParameters);
#endregion

#region Object ExecuteScalar(String sqlQuery, String name, Object value)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="sqlQuery">sql查询</param>
/// <param name="name">参数名</param>
/// <param name="value">参数值</param>
/// <returns>Object</returns>
Object ExecuteScalar(DataSet myDataSet, String sqlQuery, String name, Object value);
#endregion

#region Object ExecuteScalar(String sqlQuery, String[] names, Object[] values)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="sqlQuery">sql查询</param>
/// <param name="names">参数名集</param>
/// <param name="values">参数值集</param>
/// <returns>Object</returns>
Object ExecuteScalar(String sqlQuery, String[] names, Object[] values);
#endregion

#region Object ExecuteScalar(CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>Object</returns>
Object ExecuteScalar(CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters);
#endregion

#region Object ExecuteScalar(CommandType myCommandType, String sqlQuery, String[] names, Object[] values)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="names">参数名集</param>
/// <param name="values">参数值集</param>
/// <returns>Object</returns>
Object ExecuteScalar(CommandType myCommandType, String sqlQuery, String[] names, Object[] values);
#endregion

#region Object ExecuteScalar(IDbTransaction myOleDbTransaction, CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="myOleDbTransaction">数据库事务</param>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>Object</returns>
Object ExecuteScalar(IDbTransaction myOleDbTransaction, CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters);
#endregion

#region Object ExecuteScalar(IDbTransaction myOleDbTransaction, CommandType myCommandType, String sqlQuery, String[] names, Object[] values)
/// <summary>
/// 执行查询
/// </summary>
/// <param name="myOleDbTransaction">数据库事务</param>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="names">参数名集</param>
/// <param name="values">参数值集</param>
/// <returns>Object</returns>
Object ExecuteScalar(IDbTransaction myOleDbTransaction, CommandType myCommandType, String sqlQuery, String[] names, Object[] values);
#endregion


#region DataTable Fill(DataTable myDataTable, String sqlQuery)
/// <summary>
/// 填充数据表
/// </summary>
/// <param name="myDataTable">目标数据表</param>
/// <param name="sqlQuery">查询</param>
/// <returns>数据表</returns>
DataTable Fill(DataTable myDataTable, String sqlQuery);
#endregion

#region DataTable Fill(DataTable myDataTable, String sqlQuery, DbParameter[] myDbParameters)
/// <summary>
/// 填充数据表
/// </summary>
/// <param name="myDataTable">目标数据表</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>数据表</returns>
DataTable Fill(DataTable myDataTable, String sqlQuery, DbParameter[] myDbParameters);
#endregion

#region DataTable Fill(DataTable myDataTable, String sqlQuery, String name, Object value)
/// <summary>
/// 填充数据表
/// </summary>
/// <param name="myDataTable">目标数据表</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="name">参数名</param>
/// <param name="value">参数值</param>
/// <returns>数据表</returns>
DataTable Fill(DataTable myDataTable, String sqlQuery, String name, Object value);
#endregion


#region DataTable Fill(DataTable myDataTable, String sqlQuery, String[] names, Object[] values)
/// <summary>
/// 填充数据表
/// </summary>
/// <param name="myDataSet">目标数据表</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="names">参数名集</param>
/// <param name="values">参数值集</param>
/// <returns>数据表</returns>
DataTable Fill(DataTable myDataTable, String sqlQuery, String[] names, Object[] values);
#endregion

#region DataTable Fill(DataTable myDataTable, CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters)
/// <summary>
/// 填充数据表
/// </summary>
/// <param name="myDataSet">目标数据表</param>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>数据表</returns>
DataTable Fill(DataTable myDataTable, CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters);
#endregion

#region DataTable Fill(DataTable myDataTable, CommandType myCommandType, String sqlQuery, String[] names, Object[] values)
/// <summary>
/// 填充数据表
/// </summary>
/// <param name="myDataSet">目标数据表</param>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="names">参数名</param>
/// <param name="values">参数值</param>
/// <returns>数据表</returns>
DataTable Fill(DataTable myDataTable, CommandType myCommandType, String sqlQuery, String[] names, Object[] values);
#endregion


#region DataSet Fill(DataSet myDataSet, String sqlQuery, String tableName)
/// <summary>
/// 填充数据集
/// </summary>
/// <param name="myDataSet">目标数据集</param>
/// <param name="sqlQuery">查询</param>
/// <param name="tableName">填充表</param>
/// <returns>数据集</returns>
DataSet Fill(DataSet myDataSet, String sqlQuery, String tableName);
#endregion

#region DataSet Fill(DataSet myDataSet, String sqlQuery, String tableName, DbParameter[] myDbParameters)
/// <summary>
/// 填充数据集
/// </summary>
/// <param name="myDataSet">数据集</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="tableName">填充表</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>数据集</returns>
DataSet Fill(DataSet myDataSet, String sqlQuery, String tableName, DbParameter[] myDbParameters);
#endregion

#region DataSet Fill(DataSet myDataSet, String sqlQuery, String tableName, String name, Object value)
/// <summary>
/// 填充数据集
/// </summary>
/// <param name="myDataSet">数据集</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="tableName">填充表</param>
/// <param name="name">参数名</param>
/// <param name="value">参数值</param>
/// <returns>数据集</returns>
DataSet Fill(DataSet myDataSet, String sqlQuery, String tableName, String name, Object value);
#endregion

#region DataSet Fill(DataSet myDataSet, String sqlQuery, String tableName, String[] names, Object[] values)
/// <summary>
/// 填充数据集
/// </summary>
/// <param name="myDataSet">数据集</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="tableName">填充表</param>
/// <param name="names">参数名集</param>
/// <param name="values">参数值集</param>
/// <returns>数据集</returns>
DataSet Fill(DataSet myDataSet, String sqlQuery, String tableName, String[] names, Object[] values);
#endregion

#region DataSet Fill(DataSet myDataSet, CommandType myCommandType, String sqlQuery, String tableName, DbParameter[] myDbParameters)
/// <summary>
/// 填充数据集
/// </summary>
/// <param name="myDataSet">数据集</param>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="tableName">填充表</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>数据集</returns>
DataSet Fill(DataSet myDataSet, CommandType myCommandType, String sqlQuery, String tableName, DbParameter[] myDbParameters);
#endregion

#region DataSet Fill(DataSet myDataSet, CommandType myCommandType, String sqlQuery, String tableName, String[] names, Object[] values)
/// <summary>
/// 填充数据集
/// </summary>
/// <param name="myDataSet">数据集</param>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="tableName">填充表</param>
/// <param name="names">参数名集</param>
/// <param name="values">参数值集</param>
/// <returns>数据集</returns>
DataSet Fill(DataSet myDataSet, CommandType myCommandType, String sqlQuery, String tableName, String[] names, Object[] values);
#endregion


#region int ExecuteProcedure(String procedureName)
/// <summary>
/// 执行数据库查询
/// </summary>
/// <param name="procedureName">存储过程</param>
/// <returns>影响行数</returns>
int ExecuteProcedure(String procedureName);
#endregion

#region int ExecuteProcedure(String procedureName, DbParameter[] myDbParameters)
/// <summary>
/// 执行存储过程
/// </summary>
/// <param name="procedureName">存储过程名</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>影响行数</returns>
int ExecuteProcedure(String procedureName, DbParameter[] myDbParameters);
#endregion

#region int ExecuteProcedure(String procedureName, String name, String value)
/// <summary>
/// 执行存储过程
/// </summary>
/// <param name="procedureName">存储过程名</param>
/// <param name="name">参数名</param>
/// <param name="value">参数值</param>
/// <returns>影响行数</returns>
int ExecuteProcedure(String procedureName, String name, String value);
#endregion

#region int ExecuteProcedure(String procedureName, String[] names, Object[] values)
/// <summary>
/// 执行数据库脚本
/// </summary>
/// <param name="procedureName">存储过程</param>
/// <param name="names">参数名集</param>
/// <param name="values">参数值集</param>
/// <returns>影响行数</returns>
int ExecuteProcedure(String procedureName, String[] names, Object[] values);
#endregion

#region DataSet ExecuteProcedureForDataSet(DataSet myDataSet, String procedureName, String tableName, DbParameter[] myDbParameters)
/// <summary>
/// 执行数据库脚本
/// </summary>
/// <param name="myDataSet">数据集</param>
/// <param name="procedureName">存储过程</param>
/// <param name="tableName">填充表</param>
/// <param name="myDbParameterCollection">参数集</param>
/// <returns>数据集</returns>
DataSet ExecuteProcedureForDataSet(DataSet myDataSet, String procedureName, String tableName, DbParameter[] myDbParameters);
#endregion

#region DataSet ExecuteProcedureForDataSet(DataSet myDataSet, String procedureName, String tableName, String[] names, Object[] values)
/// <summary>
/// 执行数据库脚本
/// </summary>
/// <param name="myDataSet">数据集</param>
/// <param name="procedureName">存储过程</param>
/// <param name="tableName">填充表</param>
/// <param name="names">参数名集</param>
/// <param name="values">参数值集</param>
/// <returns>数据集</returns>
DataSet ExecuteProcedureForDataSet(DataSet myDataSet, String procedureName, String tableName, String[] names, Object[] values);
#endregion


#region IDbTransaction BeginTransaction()
/// <summary>
/// 事务开始
/// </summary>
/// <returns>事务</returns>
IDbTransaction BeginTransaction();
#endregion

#region void CommitTransaction()
/// <summary>
/// 递交事务
/// </summary>
void CommitTransaction();
#endregion

#region void RollbackTransaction()
/// <summary>
/// 回滚事务
/// </summary>
void RollbackTransaction();
#endregion

#region void ExecuteNonQueryAsync(CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters);
/// <summary>
/// 异步调用数据库查询
/// </summary>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="myDbParameterCollection">参数集</param>
void ExecuteNonQueryAsync(CommandType myCommandType, String sqlQuery, DbParameter[] myDbParameters);
#endregion

#region void ExecuteNonQueryAsync(CommandType myCommandType, String sqlQuery, String[] names, Object[] values)
/// <summary>
/// 异步调用数据库查询
/// </summary>
/// <param name="myCommandType">命令分类</param>
/// <param name="sqlQuery">sql查询</param>
/// <param name="names">参数名集</param>
/// <param name="values">参数值集</param>
void ExecuteNonQueryAsync(CommandType myCommandType, String sqlQuery, String[] names, Object[] values);
#endregion

#region void ExecuteProcedureAsync(String procedureName, DbParameter[] myDbParameters)
/// <summary>
/// 异步调用数据库查询
/// </summary>
/// <param name="procedureName">存储过程</param>
/// <param name="myDbParameterCollection">参数集</param>
void ExecuteProcedureAsync(String procedureName, DbParameter[] myDbParameters);
#endregion

#region void ExecuteProcedureAsync(String procedureName, String[] names, Object[] values)
/// <summary>
/// 异步调用数据库查询
/// </summary>
/// <param name="procedureName">存储过程</param>
/// <param name="names">参数名集</param>
/// <param name="values">参数值集</param>
void ExecuteProcedureAsync(String procedureName, String[] names, Object[] values);
#endregion


#region void Close()
/// <summary>
/// 关闭数据库连接
/// </summary>
void Close();
#endregion
}
}