| 高效好用的数据访问层 using System; using System.Data; using System.Data.SqlClient; namespace JYK { /// /// 存储过程的参数的类型,在输出型的参数里使用。 /// public enum ParameterKind { Int,Double,Decimal,NVarChar,Bit } /// /// 这是一个通用的数据访问层接口。类似于 SQLHelper /// public sealed class DataAccessLayer { #region 属性 private static string errorMsg; //出错信息 private static bool isShowErrorSQL; //是否显示出错的查询语句(包括存储过程名程) private int executeRowCount; //获取执行SQL查询语句后影响的行数 private SqlCommand cm = new SqlCommand(); //建立Command对象 private SqlTransaction sqlTrans ; //用于事务处理 private bool isUseTrans; //是否启用了 .net 的事务处理 /// /// 读取出错信息 /// public string ErrorMsg { get{return errorMsg;} } /// /// % |
| |